Class SemaphoreSlimPool
Provides a pool of SemaphoreSlim objects to manage resource usage efficiently.
Inherited Members
Namespace: Glitch9
Assembly: Glitch9.dll
Syntax
public static class SemaphoreSlimPool
Methods
| Edit this page View SourceGet()
Gets a SemaphoreSlim from the pool.
Declaration
public static SemaphoreSlim Get()
Returns
| Type | Description |
|---|---|
| SemaphoreSlim | A SemaphoreSlim instance. |
GetAsync(out SemaphoreSlim)
Gets a pooled SemaphoreSlim and outputs it.
Declaration
public static PooledObject<SemaphoreSlim> GetAsync(out SemaphoreSlim semaphore)
Parameters
| Type | Name | Description |
|---|---|---|
| SemaphoreSlim | semaphore | The SemaphoreSlim instance. |
Returns
| Type | Description |
|---|---|
| PooledObject<SemaphoreSlim> | A pooled SemaphoreSlim instance. |
Release(SemaphoreSlim)
Releases a SemaphoreSlim back to the pool.
Declaration
public static void Release(SemaphoreSlim toRelease)
Parameters
| Type | Name | Description |
|---|---|---|
| SemaphoreSlim | toRelease | The SemaphoreSlim to release. |