OidCollection.SyncRoot 属性
定义
获取一个对象,该对象可用于同步对 OidCollection 对象的访问。Gets an object that can be used to synchronize access to the OidCollection object.
public:
property System::Object ^ SyncRoot { System::Object ^ get(); };
public object SyncRoot { get; }
member this.SyncRoot : obj
Public ReadOnly Property SyncRoot As Object
属性值
一个对象,该对象可用于同步对 OidCollection 对象的访问。An object that can be used to synchronize access to the OidCollection object.
实现
注解
OidCollection 不是线程安全的。OidCollection is not thread safe. 派生类可以使用此属性为类提供自己的同步版本 OidCollection 。Derived classes can provide their own synchronized version of the OidCollection class using this property. 同步代码必须对对象的属性执行操作 SyncRoot OidCollection ,而不是直接对对象本身执行操作。The synchronizing code must perform operations on the SyncRoot property of the OidCollection object, not directly on the object itself. 这样可确保对从其他对象派生的集合正确地执行操作。This ensures proper operation of collections that are derived from other objects. 具体而言,它与其他可能同时修改对象的线程保持正确同步 OidCollection 。Specifically, it maintains proper synchronization with other threads that might simultaneously be modifying the OidCollection object.