• Performance
  • API Documentation
  • Source Code
Show / Hide Table of Contents
  • InSync
    • AsyncSynchronized
    • AsyncSynchronized<T>
    • GuardedValue<T>
    • IAsyncSynchronized<T>
    • IBareAsyncLock
    • IBareAsyncLock<T>
    • IBareLock
    • IBareLock<T>
    • ISynchronized<T>
    • LockException
    • MultiSync
    • ReaderSynchronized<TRead>
    • ReaderWriterSynchronized<T>
    • ReaderWriterSynchronized<TWrite, TRead>
    • ReaderWriterSynchronizedFactory
    • Synchronized
    • Synchronized<T>
    • TimingMethod
    • UnlockException
    • UpgradeableReaderSynchronized<TRead>
    • ValueContainer<T>

Interface IBareAsyncLock<T>

This interface provides abstraction of synchronization. It also allows its protected object to be accessed only after a synchronization begins.

Various asynchronous operations are supported. The protected object is non-null.

Inherited Members
IBareAsyncLock.BarelyTryLock(Nullable<Object>)
IBareAsyncLock.BarelyUnlock()
Namespace: InSync
Assembly: InSync.dll
Syntax
public interface IBareAsyncLock<T> : IBareAsyncLock where T : class
Type Parameters
Name Description
T

The type of the protected object.

Methods

BarelyLockAsync()

Asynchronously acquires the lock and returns the protected non-null value.

Declaration
Task<T> BarelyLockAsync()
Returns
Type Description
Task<T>

The protected non-null value.

Exceptions
Type Condition
LockException

BarelyLockAsync(CancellationToken)

Asynchronously acquires the lock and returns the protected non-null value.

Declaration
Task<T> BarelyLockAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<T>

The protected non-null value.

Exceptions
Type Condition
LockException

BarelyTryLock(out T)

Tries to acquire the lock. It returns true and the protected non-null value if the lock is acquired.

Declaration
bool BarelyTryLock(out T value)
Parameters
Type Name Description
T value

The protected non-null value if the lock is acquired, otherwise, null is returned.

Returns
Type Description
System.Boolean

true if the lock is acquired.

Exceptions
Type Condition
LockException
In This Article
Back to top Generated by DocFX