mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-15 14:19:29 +00:00
17 lines
516 B
C#
17 lines
516 B
C#
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace System.Extensions;
|
|
public static class SemaphoreSlimExtensions
|
|
{
|
|
public static async Task<SemaphoreSlimContext> Acquire(this SemaphoreSlim semaphore)
|
|
{
|
|
return await SemaphoreSlimContext.Create(semaphore);
|
|
}
|
|
|
|
public static async Task<SemaphoreSlimContext> Acquire(this SemaphoreSlim semaphore, CancellationToken cancellationToken)
|
|
{
|
|
return await SemaphoreSlimContext.Create(semaphore, cancellationToken);
|
|
}
|
|
}
|