AsyncCrossProcessMutex.EnterAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
EnterAsync() |
Acquires the mutex asynchronously. |
EnterAsync(TimeSpan) |
Acquires the mutex asynchronously. |
EnterAsync()
Acquires the mutex asynchronously.
public System.Threading.Tasks.Task<Microsoft.VisualStudio.Threading.AsyncCrossProcessMutex.LockReleaser> EnterAsync ();
member this.EnterAsync : unit -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Threading.AsyncCrossProcessMutex.LockReleaser>
Public Function EnterAsync () As Task(Of AsyncCrossProcessMutex.LockReleaser)
Returns
A value whose disposal will release the mutex.
Applies to
EnterAsync(TimeSpan)
Acquires the mutex asynchronously.
public System.Threading.Tasks.Task<Microsoft.VisualStudio.Threading.AsyncCrossProcessMutex.LockReleaser> EnterAsync (TimeSpan timeout);
member this.EnterAsync : TimeSpan -> System.Threading.Tasks.Task<Microsoft.VisualStudio.Threading.AsyncCrossProcessMutex.LockReleaser>
Public Function EnterAsync (timeout As TimeSpan) As Task(Of AsyncCrossProcessMutex.LockReleaser)
Parameters
- timeout
- TimeSpan
The maximum time to wait before timing out. Use InfiniteTimeSpan for no timeout, or Zero to acquire the mutex only if it is immediately available.
Returns
A value whose disposal will release the mutex.
Exceptions
Thrown from the awaited result if the mutex could not be acquired within the specified timeout.
Thrown from the awaited result if the timeout
is a negative number other than -1 milliseconds, which represents an infinite timeout.
Thrown if called before a prior call to this method has completed, with its releaser disposed if the mutex was entered.