C# Class System.Threading.ReaderWriterLock

Inheritance: System.Runtime.ConstrainedExecution.CriticalFinalizerObject
Datei anzeigen Open project: dotnet/corefx Class Usage Examples

Public Methods

Method 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

Method 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 method

public AcquireReaderLock ( System.TimeSpan timeout ) : void
timeout System.TimeSpan
return void

AcquireReaderLock() public method

public AcquireReaderLock ( int millisecondsTimeout ) : void
millisecondsTimeout int
return void

AcquireWriterLock() public method

public AcquireWriterLock ( System.TimeSpan timeout ) : void
timeout System.TimeSpan
return void

AcquireWriterLock() public method

public AcquireWriterLock ( int millisecondsTimeout ) : void
millisecondsTimeout int
return void

AnyWritersSince() public method

public AnyWritersSince ( int seqNum ) : bool
seqNum int
return bool

DowngradeFromWriterLock() public method

public DowngradeFromWriterLock ( LockCookie &lockCookie ) : void
lockCookie LockCookie
return void

ReaderWriterLock() public method

public ReaderWriterLock ( ) : System.Diagnostics
return System.Diagnostics

ReleaseLock() public method

public ReleaseLock ( ) : LockCookie
return LockCookie

ReleaseReaderLock() public method

public ReleaseReaderLock ( ) : void
return void

ReleaseWriterLock() public method

public ReleaseWriterLock ( ) : void
return void

RestoreLock() public method

public RestoreLock ( LockCookie &lockCookie ) : void
lockCookie LockCookie
return void

UpgradeToWriterLock() public method

public UpgradeToWriterLock ( System.TimeSpan timeout ) : LockCookie
timeout System.TimeSpan
return LockCookie

UpgradeToWriterLock() public method

public UpgradeToWriterLock ( int millisecondsTimeout ) : LockCookie
millisecondsTimeout int
return LockCookie