public sealed class ReaderWriterLock
|
Timeout is in milliseconds. The following table shows the possible timeout values.
| Value | Description |
|---|---|
| -1 | Infinite. |
| 0 | No timeout. |
| >0 | The number of milliseconds to wait. |
Negative numbers are interpreted as unsigned, with the exception of -1, which has special meaning.
| ctor #1 | Default constructor. This constructor is called by derived class constructors to initialize state in this type. Initializes a new instance of the ReaderWriterLock class. |
| IsReaderLockHeld | Read-only Gets a value indicating whether the current thread holds the reader lock. |
| IsWriterLockHeld | Read-only Gets a value indicating whether the current thread holds the writer lock. |
| WriterSeqNum | Read-only Gets the current sequence number. |
| AcquireReaderLock | Overloaded:AcquireReaderLock(int millisecondsTimeout) Acquires reader lock, using an Int32 value for the timeout. |
| AcquireReaderLock | Overloaded:AcquireReaderLock(TimeSpan timeout) Acquires the reader lock, using a TimeSpan value for the timeout. |
| AcquireWriterLock | Overloaded:AcquireWriterLock(int millisecondsTimeout) Acquires the writer lock, using an Int32 value for the timeout. |
| AcquireWriterLock | Overloaded:AcquireWriterLock(TimeSpan timeout) Acquires the writer lock, using a TimeSpan value for the timeout. |
| AnyWritersSince | Indicates whether intermediate writes have occurred since the sequence number was obtained. |
| DowngradeFromWriterLock | Restores the lock status of the thread to when it calls ReaderWriterLock.UpgradeToWriterLock. |
| Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
| GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
| GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
| ReleaseLock | Releases the lock, regardless of the number of times the thread acquired the lock. |
| ReleaseReaderLock | Releases the reader lock. |
| ReleaseWriterLock | Releases the writer lock. |
| RestoreLock | Restores the lock status of the thread to what it was before calling ReaderWriterLock.ReleaseLock. |
| ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
| UpgradeToWriterLock | Overloaded:UpgradeToWriterLock(int millisecondsTimeout) Upgrades the reader thread to a writer, using an Int32 value for the timeout. |
| UpgradeToWriterLock | Overloaded:UpgradeToWriterLock(TimeSpan timeout) Upgrades the reader thread to a writer, using a TimeSpan value for the timeout. |
| Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
| MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public ReaderWriterLock(); |
public bool IsReaderLockHeld {get;}
|
public bool IsWriterLockHeld {get;}
|
public int WriterSeqNum {get;}
|
public void AcquireReaderLock( |
millisecondsTimeout
public void AcquireReaderLock( |
timeout
public void AcquireWriterLock( |
millisecondsTimeout
public void AcquireWriterLock( |
timeout
seqNum
public void DowngradeFromWriterLock( |
lockCookie
~ReaderWriterLock(); |
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
public LockCookie ReleaseLock(); |
public void ReleaseReaderLock(); |
public void ReleaseWriterLock(); |
public void RestoreLock( |
lockCookie
public virtual string ToString(); |
public LockCookie UpgradeToWriterLock( |
millisecondsTimeout
public LockCookie UpgradeToWriterLock( |
timeout