Yip*_*Yay 2 c# properties thread-safety
可以ICollection<T>.Count属性getter被视为原子(因此,threadsafe)?
ICollection<T>.Count
threadsafe
谢谢.
Fem*_*ref 7
不,因为您只能为实现做出假设,而不是接口.
SLa*_*aks 7
它完全取决于收藏; ICollection<T>只是一个界面.
ICollection<T>
我所知道的每个集合只是Int32在其Countgetter中返回一个字段,因此它通常是原子的. 但是,从来没有保证计数在你取得财产后没有改变.
Int32
Count
归档时间:
15 年,5 月 前
查看次数:
150 次
最近记录: