System.Threading.ReaderWriterLockSlim Members

The members of System.Threading.ReaderWriterLockSlim are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the System.Threading.ReaderWriterLockSlim class with default property values.

Initializes a new instance of the System.Threading.ReaderWriterLockSlim class, specifying the lock recursion policy.

Public Properties

[read-only]
CurrentReadCountint.

Gets the total number of unique threads that have entered the lock in read mode.

[read-only]
IsReadLockHeldbool.

Gets a value that indicates whether the current thread has entered the lock in read mode.

[read-only]
IsUpgradeableReadLockHeldbool.

Gets a value that indicates whether the current thread has entered the lock in upgradeable mode.

[read-only]
IsWriteLockHeldbool.

Gets a value that indicates whether the current thread has entered the lock in write mode.

[read-only]
RecursionPolicyLockRecursionPolicy.

Gets a value that indicates the recursion policy for the current System.Threading.ReaderWriterLockSlim object.

[read-only]
RecursiveReadCountint.

Gets the number of times the current thread has entered the lock in read mode, as an indication of recursion.

[read-only]
RecursiveUpgradeCountint.

Gets the number of times the current thread has entered the lock in upgradeable mode, as an indication of recursion.

[read-only]
RecursiveWriteCountint.

Gets the number of times the current thread has entered the lock in write mode, as an indication of recursion.

[read-only]
WaitingReadCountint.

Gets the total number of threads that are waiting to enter the lock in read mode.

[read-only]
WaitingUpgradeCountint.

Gets the total number of threads that are waiting to enter the lock in upgradeable mode.

[read-only]
WaitingWriteCountint.

Gets the total number of threads that are waiting to enter the lock in write mode.

Public Methods

Dispose()

Releases all resources used by the current instance of the System.Threading.ReaderWriterLockSlim class.

EnterReadLock()

Tries to enter the lock in read mode.

EnterUpgradeableReadLock()

Tries to enter the lock in upgradeable mode.

EnterWriteLock()

Tries to enter the lock in write mode.

ExitReadLock()

Reduces the recursion count for read mode, and exits read mode if the resulting count is 0 (zero).

ExitUpgradeableReadLock()

Reduces the recursion count for upgradeable mode, and exits upgradeable mode if the resulting count is 0 (zero).

ExitWriteLock()

Reduces the recursion count for write mode, and exits write mode if the resulting count is 0 (zero).

TryEnterReadLock(int) : bool

Tries to enter the lock in read mode, with an optional integer time-out.

TryEnterReadLock(TimeSpan) : bool

Tries to enter the lock in read mode, with an optional time-out.

TryEnterUpgradeableReadLock(int) : bool

Tries to enter the lock in upgradeable mode, with an optional time-out.

TryEnterUpgradeableReadLock(TimeSpan) : bool

Tries to enter the lock in upgradeable mode, with an optional time-out.

TryEnterWriteLock(int) : bool

Tries to enter the lock in write mode, with an optional time-out.

TryEnterWriteLock(TimeSpan) : bool

Tries to enter the lock in write mode, with an optional time-out.