Partager via


ArrayList.SyncRoot Property

Gets an object that you can use to synchronize access to the ArrayList collection.

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)

Syntax

public virtual Object SyncRoot { get; }

Property Value

An object that you can use to synchronize access to the ArrayList collection.

Remarks

Using the SyncRoot property, you can have derived classes create their own synchronized version of the ArrayList collection. The synchronizing code must perform operations on the SyncRoot property of the ArrayList collection, not directly on the collection itself. This ensures that objects in collections derived from other objects will function properly. Specifically, SyncRoot maintains proper synchronization with other threads that might be simultaneously modifying one or more objects in the ArrayList collection.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, and 4.1.

See Also

Reference

ArrayList Class
ArrayList Members
System.Collections Namespace