System.Threading.LockRecursionPolicy Enumeration

Specifies whether a lock can be entered multiple times by the same thread.


public enum LockRecursionPolicy


The default recursion policy depends on the type of lock. For the default policy and the precise behavior of lock recursion for any given lock type, see the documentation for the type. For example, the System.Threading.ReaderWriterLockSlim class does not allow a thread to enter the lock in write mode if it already entered the lock in read mode, regardless of the lock policy setting, in order to reduce the chance of deadlocks.

Currently only one lock uses this enumeration:


Member NameDescription

If a thread tries to enter a lock recursively, an exception is thrown. Some classes may allow certain recursions when this setting is in effect.


A thread can enter a lock recursively. Some classes may restrict this capability.


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