C# Class System.Threading.ReaderWriterLock.ThreadLocalLockEntry

Stores thread-local lock info and manages the association of this info with each ReaderWriterLock owned by a thread. The original code maintained lists of thread-local lock entries on the CLR's thread objects, and manually released lock entries, which involved walking through all threads. While this is possible with ThreadLocal, this implementation prefers to use a similar design to that from ReaderWriterLockSlim, and allow reusing free entries without removing entries, since it is unlikely that the list length for any thread would get unreasonably long.
Afficher le fichier Open project: dotnet/corefx

Méthodes publiques

Свойство Type Description
_readerLevel ushort

Méthodes publiques

Méthode Description
GetCurrent ( long lockID ) : ThreadLocalLockEntry
GetOrCreateCurrent ( long lockID ) : ThreadLocalLockEntry
HasLockID ( long lockID ) : bool

Private Methods

Méthode Description
GetOrCreateCurrentSlow ( long lockID, ThreadLocalLockEntry headEntry ) : ThreadLocalLockEntry
ThreadLocalLockEntry ( long lockID ) : System.Diagnostics
VerifyNoNonemptyEntryInListAfter ( long lockID, ThreadLocalLockEntry afterEntry ) : void

Method Details

GetCurrent() public static méthode

public static GetCurrent ( long lockID ) : ThreadLocalLockEntry
lockID long
Résultat ThreadLocalLockEntry

GetOrCreateCurrent() public static méthode

public static GetOrCreateCurrent ( long lockID ) : ThreadLocalLockEntry
lockID long
Résultat ThreadLocalLockEntry

HasLockID() public méthode

public HasLockID ( long lockID ) : bool
lockID long
Résultat bool

Property Details

_readerLevel public_oe property

public ushort _readerLevel
Résultat ushort