This documentation is archived and is not being maintained.

HttpStaticObjectsCollection.SyncRoot Property

Gets an object that can be used to synchronize access to the collection.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

public Object SyncRoot { get; }

Property Value

Type: System.Object
The current HttpStaticObjectsCollection.

Implements

ICollection.SyncRoot

Program code should generally perform synchronized operations on the SyncRoot of a collection, not directly on the collection itself. This ensures proper operation of collections that are derived from other objects. Specifically, it maintains proper synchronization with other threads that might be simultaneously modifying the collection object.

The object returned in this implementation is the HttpStaticObjectsCollection itself.

The following example creates an object used to synchronize access to the HttpStaticObjectsCollection.


Object MySyncObject = Application.StaticObjects.SyncRoot;
   


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: