System.Threading.LockRecursionPolicy Enumeration

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

Syntax

public enum LockRecursionPolicy

Remarks

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:

Members

Member NameDescription
NoRecursion

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.

SupportsRecursion

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

Requirements

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