PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingConcurrent­Access­Token
Open sandboxFocus

ConcurrentAccessToken Class

Token returned by the AcquireAccess(ObjectAccessLevel, ref ConcurrentAccessToken) method. This token is intended to be used in a using block. Consumers of this method must call Complete() on success, and Dispose() on exception.

Inheritance
ConcurrentAccessToken
Implements
IDisposable
Namespace: PostSharp.Patterns.Threading
Assembly: PostSharp.Patterns.Common.dll
Syntax
public sealed class ConcurrentAccessToken : ValueType

Properties

Name Description
Null

Gets a null instance of the ConcurrentAccessToken type.

Methods

Name Description
Cancel()

Indicates that the operation requiring access on an object failed.

CheckContext(Boolean)

Determines whether the current ConcurrentAccessToken is valid in the current context.

Complete()

Indicates that the operation requiring access on an object has successfully completed.

Dispose()

Indicates that the operation requiring access on an object has completed. If the Complete() method is not invoked before the Dispose() method, the transaction is considered to have failed. Current threading models do not support transactions and therefore this semantic is currently unused, but it may be used in the future.