BaseCollection.IsSynchronized Propiedad
Definición
Obtiene un valor que indica si el acceso a ICollection está sincronizado.Gets a value indicating whether access to the ICollection is synchronized.
public:
property bool IsSynchronized { bool get(); };
[System.ComponentModel.Browsable(false)]
public bool IsSynchronized { get; }
[<System.ComponentModel.Browsable(false)>]
member this.IsSynchronized : bool
Public ReadOnly Property IsSynchronized As Boolean
Valor de propiedad
Esta propiedad devuelve siempre false
.This property always returns false
.
Implementaciones
- Atributos
Comentarios
Si una colección es segura para subprocesos, la IsSynchronized propiedad devuelve true
y el programador no tiene que hacer nada para mantener la seguridad para subprocesos de la colección.If a collection is thread safe, the IsSynchronized property returns true
, and the programmer does not have to do anything to keep the collection thread safe.
Si, como es el caso de BaseCollection , la IsSynchronized propiedad devuelve false
, la SyncRoot propiedad devuelve un objeto que se puede usar con la lock
palabra clave de C#.If, as is the case with the BaseCollection, the IsSynchronized property returns false
, then the SyncRoot property returns an object that can be used with the C# lock
keyword. Use los métodos estáticos Enter y Exit de la Monitor clase para bloquear y desbloquear manualmente el objeto de sincronización.Use the static Enter and Exit methods of the Monitor class to manually lock and unlock the synchronization object.