|
namespace KLHZ.Trader.Core.Common.Extentions
|
|
{
|
|
internal static class SemaphoreSlimExtention
|
|
{
|
|
public static async Task WaitAsync2(this SemaphoreSlim semaphore, TimeSpan timeSpan)
|
|
{
|
|
var cts = new CancellationTokenSource(timeSpan);
|
|
await semaphore.WaitAsync(cts.Token);
|
|
}
|
|
}
|
|
}
|