System.Threading.ReaderWriterLockSlim.RecursionPolicy Property

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

Syntax

public LockRecursionPolicy RecursionPolicy { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Recursion policy determines the restrictions on threads that enter the lock more than once. For example, if a lock was created with LockRecursionPolicy.NoRecursion and a thread has entered the lock in read mode, System.Threading.LockRecursionException is thrown if the thread tries to reenter the lock in read mode.

Note:

A thread in upgradeable mode can upgrade to write mode or downgrade to read mode regardless of the lock recursion policy setting.

Regardless of recursion policy, a thread that initially entered read mode is not allowed to upgrade to upgradeable mode or write mode, because that pattern creates a strong probability of deadlocks.

For more information about recursion policy and its effects, see the System.Threading.LockRecursionPolicy enumeration and the System.Threading.ReaderWriterLockSlim class.

Requirements

Namespace: System.Threading
Assembly: System.Core (in System.Core.dll)
Assembly Versions: 4.0.0.0