HttpStaticObjectsCollection.SyncRoot Property

Definition

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

C#
public object SyncRoot { get; }

Property Value

The current HttpStaticObjectsCollection.

Implements

Examples

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

C#
Object MySyncObject = Application.StaticObjects.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.

Applies to

Produto Versões
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1