PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingIConcurrency­ControllerAcquire­Access­Async
Open sandboxFocus

Method AcquireAccessAsync

AcquireAccessAsync(ObjectAccessLevel)

Asynchronously acquires access on the entity for the current thread and returns an async awaiter.

Declaration
ConcurrentAccessAwaiter AcquireAccessAsync(ObjectAccessLevel objectAccessLevel)
Parameters
Type Name Description
ObjectAccessLevel objectAccessLevel

The required access level on the entity.

Returns
Type Description
ConcurrentAccessAwaiter

a ConcurrentAccessAwaiter compatible with the await keyword, and evaluating to an opaque ConcurrentAccessToken typically used in a using block. Consumers must invoke the Complete() method upon success before exiting the using block.