C# Class Catel.Threading.AsyncLock

Show file Open project: Catel/Catel Class Usage Examples

Public Methods

Method Description
AsyncLock ( ) : System

Creates a new async-compatible mutual exclusion lock.

AsyncLock ( IAsyncWaitQueue queue ) : System

Creates a new async-compatible mutual exclusion lock using the specified wait queue.

Lock ( ) : IDisposable

Synchronously acquires the lock. Returns a disposable that releases the lock when disposed. This method may block the calling thread.

Lock ( CancellationToken cancellationToken ) : IDisposable

Synchronously acquires the lock. Returns a disposable that releases the lock when disposed. This method may block the calling thread.

LockAsync ( ) : AwaitableDisposable

Asynchronously acquires the lock. Returns a disposable that releases the lock when disposed.

LockAsync ( CancellationToken cancellationToken ) : AwaitableDisposable

Asynchronously acquires the lock. Returns a disposable that releases the lock when disposed.

Private Methods

Method Description
ReleaseLock ( ) : void

Releases the lock.

Method Details

AsyncLock() public method

Creates a new async-compatible mutual exclusion lock.
public AsyncLock ( ) : System
return System

AsyncLock() public method

Creates a new async-compatible mutual exclusion lock using the specified wait queue.
public AsyncLock ( IAsyncWaitQueue queue ) : System
queue IAsyncWaitQueue The wait queue used to manage waiters.
return System

Lock() public method

Synchronously acquires the lock. Returns a disposable that releases the lock when disposed. This method may block the calling thread.
public Lock ( ) : IDisposable
return IDisposable

Lock() public method

Synchronously acquires the lock. Returns a disposable that releases the lock when disposed. This method may block the calling thread.
public Lock ( CancellationToken cancellationToken ) : IDisposable
cancellationToken System.Threading.CancellationToken The cancellation token used to cancel the lock. If this is already set, then this method will attempt to take the lock immediately (succeeding if the lock is currently available).
return IDisposable

LockAsync() public method

Asynchronously acquires the lock. Returns a disposable that releases the lock when disposed.
public LockAsync ( ) : AwaitableDisposable
return AwaitableDisposable

LockAsync() public method

Asynchronously acquires the lock. Returns a disposable that releases the lock when disposed.
public LockAsync ( CancellationToken cancellationToken ) : AwaitableDisposable
cancellationToken System.Threading.CancellationToken The cancellation token used to cancel the lock. If this is already set, then this method will attempt to take the lock immediately (succeeding if the lock is currently available).
return AwaitableDisposable