Table of Contents

Class SemaphoreSlimExt

Namespace
TCSystem.Thread
Assembly
TCSystem.Thread.dll

Provides disposable lock scopes for SemaphoreSlim.

public static class SemaphoreSlimExt
Inheritance
SemaphoreSlimExt
Inherited Members

Methods

Lock(SemaphoreSlim)

Waits for the semaphore and returns a scope that releases it when disposed.

public static IDisposable Lock(this SemaphoreSlim semaphore)

Parameters

semaphore SemaphoreSlim

Returns

IDisposable

LockAsync(SemaphoreSlim)

Asynchronously waits for the semaphore and returns a scope that releases it when disposed.

public static Task<IDisposable> LockAsync(this SemaphoreSlim semaphore)

Parameters

semaphore SemaphoreSlim

Returns

Task<IDisposable>