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.

[Visual Basic]
Public Overridable ReadOnly Property SyncRoot As Object  Implements _
   ICollection.SyncRoot
[C#]
public virtual object SyncRoot {get;}
[C++]
public: __property virtual Object* get_SyncRoot();
[JScript]
public function get SyncRoot() : Object;

Property Value

The current HttpStaticObjectsCollection.

Implements

ICollection.SyncRoot

Remarks

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.

Example

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

[Visual Basic] 
Dim MySyncObject As Object = Application.StaticObjects.SyncRoot
   

[C#] 
Object MySyncObject = Application.StaticObjects.SyncRoot;
   

[C++] 
Object* MySyncObject = Application->StaticObjects->SyncRoot;
   

[JScript] 
var mySyncObject : Object = Application.StaticObjects.SyncRoot
   

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpStaticObjectsCollection Class | HttpStaticObjectsCollection Members | System.Web Namespace

Show: