Oracle® Coherence .NET API Reference Release 3.7.1
E22844-03
Assembly: Coherence (in Coherence.dll) Version: 3.7.1.23 (3.7.1.23)
E22844-03
Acquire a write lock.
Namespace:
Tangosol.Util.CollectionsAssembly: Coherence (in Coherence.dll) Version: 3.7.1.23 (3.7.1.23)
Syntax
| C# |
|---|
public void AcquireWriteLock() |
Remarks
This method will block until the write lock is acquired.
Only a single thread can hold the write lock at any given time,
and no other threads will be able to acquire either a read lock
or a write lock until the write lock is released.
This method should always be used in combination with a
ReleaseWriteLock()()() method in the following manner:
CopyC#
This will ensure that the lock is released properly even if an
exception is thrown by the code within the try block.
dict.AcquireWriteLock(); try { // access dictionary } finally { dict.ReleaseWriteLock(); }