针对当前用户进行加锁
private readonly static Dictionary<long, object> dic = new Dictionary<long, object>();
方法内部加入
object syncLocker = new object();
dic.TryGetValue(AbpSession.UserId.Value, out syncLocker);
if (syncLocker == null)
{
syncLocker = new object();
dic.Add(AbpSession.UserId.Value, syncLocker);
}
lock (syncLocker)
{
}