mscorlib 4.0.0.0 System.Object System.IDisposable System.Diagnostics.DebuggerDisplay("Current Count = {currCount}")

The provides a lightweight semaphore class that doesn't use Windows kernel semaphores.

A lightweight alternative to that limits the number of threads that can access a resource or pool of resources concurrently.

- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class, specifying the initial number of requests that can be granted concurrently.

  The initial number of requests for the semaphore that can be granted concurrently.
- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class, specifying the initial and maximum number of requests that can be granted concurrently.

  The initial number of requests for the semaphore that can be granted concurrently.
  The maximum number of requests for the semaphore that can be granted concurrently.
- Property
  4.0.0.0
  System.Threading.WaitHandle To be added.

  Use this property only when you must wait on a SemaphoreSlim together with other kernel-based synchronization objects with the same wait handle. A successful wait on the does not imply a successful wait on the itself, nor does it decrement the semaphore's count. After the available wait handle is signaled, you should wait on the specifically.

  Returns a that can be used to wait on the semaphore.

- Property
  4.0.0.0
  System.Int32 To be added. To be added.

  Gets the number of threads that will be allowed to enter the .

- Method
  4.0.0.0
  System.Void

  Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying.

  For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

  Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method.

  Releases all resources used by the current instance of the class.

- Method
  4.0.0.0
  System.Void ``

  Unlike most of the members of , is not thread-safe and may not be used concurrently with other members of this instance.

  Releases the unmanaged resources used by the , and optionally releases the managed resources.

  true to release both managed and unmanaged resources; false to release only unmanaged resources.
- Method
  4.0.0.0
  System.Int32 To be added.

  Exits the once.

  The previous count of the .

- Method
  4.0.0.0
  System.Int32 `` To be added.

  Exits the a specified number of times.

  The previous count of the .

  The number of times to exit the semaphore.
- Method
  4.0.0.0
  System.Void To be added.

  Blocks the current thread until it can enter the .

- Method
  4.0.0.0
  System.Boolean `` To be added.

  Blocks the current thread until it can enter the , using a 32-bit signed integer that specifies the timeout.

  true if the current thread successfully entered the ; otherwise, false.

  The number of milliseconds to wait, or (-1) to wait indefinitely.
- Method
  4.0.0.0
  System.Void `` To be added.

  Blocks the current thread until it can enter the , while observing a .

  The token to observe.
- Method
  4.0.0.0
  System.Boolean `` To be added.

  Blocks the current thread until it can enter the , using a to specify the timeout.

  true if the current thread successfully entered the ; otherwise, false.

  A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
- Method
  4.0.0.0
  System.Boolean `` `` To be added.

  Blocks the current thread until it can enter the , using a 32-bit signed integer that specifies the timeout, while observing a .

  true if the current thread successfully entered the ; otherwise, false.

  The number of milliseconds to wait, or (-1) to wait indefinitely. The to observe.
- Method
  4.0.0.0
  System.Boolean `` `` To be added.

  Blocks the current thread until it can enter the , using a that specifies the timeout, while observing a .

  true if the current thread successfully entered the ; otherwise, false.

  A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. The to observe.
- Method
  4.0.0.0
  System.Threading.Tasks.Task To be added.

  Asynchronously waits to enter the .

  A task that will complete when the semaphore has been entered.

- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Boolean> `` To be added.

  Asynchronously waits to enter the , using a 32-bit signed integer to measure the time interval.

  A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false.

  The number of milliseconds to wait, or (-1) to wait indefinitely.
- Method
  4.0.0.0
  System.Threading.Tasks.Task `` To be added.

  Asynchronously waits to enter the , while observing a .

  A task that will complete when the semaphore has been entered.

  The token to observe.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Boolean> `` To be added.

  Asynchronously waits to enter the , using a to measure the time interval.

  A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false.

  A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Boolean> `` `` To be added.

  Asynchronously waits to enter the , using a 32-bit signed integer to measure the time interval, while observing a .

  A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false.

  The number of milliseconds to wait, or (-1) to wait indefinitely. The to observe.
- Method
  4.0.0.0
  System.Threading.Tasks.Task<System.Boolean> `` `` To be added.

  Asynchronously waits to enter the , using a to measure the time interval, while observing a .

  A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false.

  A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. The token to observe.