.net core 异步锁

wtt123 / 2023-07-19 / 原文

using Nito.AsyncEx;

private readonly AsyncLock _mutex = new AsyncLock();

//锁保护区域
using (await _mutex.LockAsync())
{

}