C# Class System.Threading.ReaderWriterLock

Inheritance: System.Runtime.ConstrainedExecution.CriticalFinalizerObject
Afficher le fichier Open project: dotnet/corefx Class Usage Examples

Méthodes publiques

Méthode Description
AcquireReaderLock ( System.TimeSpan timeout ) : void
AcquireReaderLock ( int millisecondsTimeout ) : void
AcquireWriterLock ( System.TimeSpan timeout ) : void
AcquireWriterLock ( int millisecondsTimeout ) : void
AnyWritersSince ( int seqNum ) : bool
DowngradeFromWriterLock ( LockCookie &lockCookie ) : void
ReaderWriterLock ( ) : System.Diagnostics
ReleaseLock ( ) : LockCookie
ReleaseReaderLock ( ) : void
ReleaseWriterLock ( ) : void
RestoreLock ( LockCookie &lockCookie ) : void
UpgradeToWriterLock ( System.TimeSpan timeout ) : LockCookie
UpgradeToWriterLock ( int millisecondsTimeout ) : LockCookie

Private Methods

Méthode Description
GetCurrentThreadID ( ) : int
GetInvalidLockCookieException ( ) : ApplicationException
GetInvalidTimeoutException ( string parameterName ) : ArgumentOutOfRangeException
GetNotOwnerException ( ) : ApplicationException

The original code used an incorrect Exception.HResult for this exception. The Exception.HResult value was set to ERROR_NOT_OWNER without first converting that error code into an HRESULT. The same value is used here for compatibility.

GetOrCreateReaderEvent ( ) : ManualResetEventSlim
GetOrCreateWriterEvent ( ) : AutoResetEvent
GetTimeoutException ( ) : ApplicationException
RecoverLock ( LockCookie &lockCookie, LockCookieFlags flags ) : void

Helper function that restores the lock to the original state indicated by parameters

ReleaseEvents ( ) : void
ToTimeoutMilliseconds ( System.TimeSpan timeout ) : int
TryGetOrCreateReaderEvent ( ) : ManualResetEventSlim
TryGetOrCreateWriterEvent ( ) : AutoResetEvent
YieldProcessor ( ) : bool

Method Details

AcquireReaderLock() public méthode

public AcquireReaderLock ( System.TimeSpan timeout ) : void
timeout System.TimeSpan
Résultat void

AcquireReaderLock() public méthode

public AcquireReaderLock ( int millisecondsTimeout ) : void
millisecondsTimeout int
Résultat void

AcquireWriterLock() public méthode

public AcquireWriterLock ( System.TimeSpan timeout ) : void
timeout System.TimeSpan
Résultat void

AcquireWriterLock() public méthode

public AcquireWriterLock ( int millisecondsTimeout ) : void
millisecondsTimeout int
Résultat void

AnyWritersSince() public méthode

public AnyWritersSince ( int seqNum ) : bool
seqNum int
Résultat bool

DowngradeFromWriterLock() public méthode

public DowngradeFromWriterLock ( LockCookie &lockCookie ) : void
lockCookie LockCookie
Résultat void

ReaderWriterLock() public méthode

public ReaderWriterLock ( ) : System.Diagnostics
Résultat System.Diagnostics

ReleaseLock() public méthode

public ReleaseLock ( ) : LockCookie
Résultat LockCookie

ReleaseReaderLock() public méthode

public ReleaseReaderLock ( ) : void
Résultat void

ReleaseWriterLock() public méthode

public ReleaseWriterLock ( ) : void
Résultat void

RestoreLock() public méthode

public RestoreLock ( LockCookie &lockCookie ) : void
lockCookie LockCookie
Résultat void

UpgradeToWriterLock() public méthode

public UpgradeToWriterLock ( System.TimeSpan timeout ) : LockCookie
timeout System.TimeSpan
Résultat LockCookie

UpgradeToWriterLock() public méthode

public UpgradeToWriterLock ( int millisecondsTimeout ) : LockCookie
millisecondsTimeout int
Résultat LockCookie