AsyncSemaphore::EnterAsync Method (Int32, CancellationToken)

 

Requests access to the lock.

Namespace:   Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

public:
Task<AsyncSemaphore::Releaser>^ EnterAsync(
	int timeout,
	CancellationToken cancellationToken = null
)

Parameters

timeout
Type: System::Int32

The timeout for waiting for the lock.

cancellationToken
Type: System.Threading::CancellationToken

A token whose cancellation signals lost interest in the lock.

Return Value

Type: System.Threading.Tasks::Task<AsyncSemaphore::Releaser>^

A Task<TResult> whose result is a releaser that should be disposed to release the lock.

Return to top
Show: