Export (0) Print
Expand All

SemaphoreSlim Methods

The SemaphoreSlim type exposes the following members.

  Name Description
Public method Dispose() Releases all resources used by the current instance of the SemaphoreSlim class.
Protected method Dispose(Boolean) Releases the unmanaged resources used by the SemaphoreSlim, and optionally releases the managed resources.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Release() Exits the SemaphoreSlim once.
Public method Release(Int32) Exits the SemaphoreSlim a specified number of times.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Wait() Blocks the current thread until it can enter the SemaphoreSlim.
Public method Wait(CancellationToken) Blocks the current thread until it can enter the SemaphoreSlim, while observing a CancellationToken.
Public method Wait(Int32) Blocks the current thread until it can enter the SemaphoreSlim, using a 32-bit signed integer that specifies the timeout.
Public method Wait(TimeSpan) Blocks the current thread until it can enter the SemaphoreSlim, using a TimeSpan to specify the timeout.
Public method Wait(Int32, CancellationToken) Blocks the current thread until it can enter the SemaphoreSlim, using a 32-bit signed integer that specifies the timeout, while observing a CancellationToken.
Public method Wait(TimeSpan, CancellationToken) Blocks the current thread until it can enter the SemaphoreSlim, using a TimeSpan that specifies the timeout, while observing a CancellationToken.
Public method WaitAsync() Asynchronously waits to enter the SemaphoreSlim.
Public method WaitAsync(CancellationToken) Asynchronously waits to enter the SemaphoreSlim, while observing a CancellationToken.
Public method WaitAsync(Int32) Asynchronously waits to enter the SemaphoreSlim, using a 32-bit signed integer to measure the time interval.
Public method WaitAsync(TimeSpan) Asynchronously waits to enter the SemaphoreSlim, using a TimeSpan to measure the time interval.
Public method WaitAsync(Int32, CancellationToken) Asynchronously waits to enter the SemaphoreSlim, using a 32-bit signed integer to measure the time interval, while observing a CancellationToken.
Public method WaitAsync(TimeSpan, CancellationToken) Asynchronously waits to enter the SemaphoreSlim, using a TimeSpan to measure the time interval, while observing a CancellationToken.
Top
Show:
© 2014 Microsoft