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 read lock.
Namespace:
Tangosol.Web.ModelAssembly: Coherence (in Coherence.dll) Version: 3.7.1.23 (3.7.1.23)
Syntax
| C# |
|---|
public void AcquireReadLock() |
Remarks
This method will block until the read lock is acquired.
Multiple threads can hold read locks at the same time, but no
thread will be able to acquire a write lock until all read locks
are released.
This method should always be used in combination with a
ReleaseReadLock()()() 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.
model.AcquireReadLock(); try { // access model } finally { model.ReleaseReadLock(); }