C# Класс Catel.Threading.AsyncLock

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
ReleaseLock ( ) : void

Releases the lock.

Описание методов

AsyncLock() публичный Метод

Creates a new async-compatible mutual exclusion lock.
public AsyncLock ( ) : System
Результат System

AsyncLock() публичный Метод

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.
Результат System

Lock() публичный Метод

Synchronously acquires the lock. Returns a disposable that releases the lock when disposed. This method may block the calling thread.
public Lock ( ) : IDisposable
Результат IDisposable

Lock() публичный Метод

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).
Результат IDisposable

LockAsync() публичный Метод

Asynchronously acquires the lock. Returns a disposable that releases the lock when disposed.
public LockAsync ( ) : AwaitableDisposable
Результат AwaitableDisposable

LockAsync() публичный Метод

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).
Результат AwaitableDisposable