AsyncSemaphore.EnterAsync Method (Int32, CancellationToken)
Requests access to the lock.
Namespace: Microsoft.VisualStudio.Threading
Assembly: Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)
Syntax
'Declaration
Public Function EnterAsync ( _
timeout As Integer, _
cancellationToken As CancellationToken _
) As Task(Of AsyncSemaphore.Releaser)
public Task<AsyncSemaphore.Releaser> EnterAsync(
int timeout,
CancellationToken cancellationToken
)
public:
Task<AsyncSemaphore::Releaser>^ EnterAsync(
int timeout,
CancellationToken cancellationToken
)
member EnterAsync :
timeout:int *
cancellationToken:CancellationToken -> Task<AsyncSemaphore.Releaser>
public function EnterAsync(
timeout : int,
cancellationToken : CancellationToken
) : Task<AsyncSemaphore.Releaser>
Parameters
timeout
Type: System.Int32The timeout for waiting for the lock.
cancellationToken
Type: System.Threading.CancellationTokenA 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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.