Export (0) Print
Expand All

ReaderWriterLockSlim.RecursionPolicy Property

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

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

public LockRecursionPolicy RecursionPolicy { get; }

Property Value

Type: System.Threading.LockRecursionPolicy
One of the enumeration values that specifies the lock recursion policy.

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, LockRecursionException is thrown if the thread tries to reenter the lock in read mode.

NoteNote:

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 LockRecursionPolicy enumeration and the ReaderWriterLockSlim class.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2014 Microsoft