示例#1
0
        public static LockResult Create(Mutex mutex)
        {
            if (ReferenceEquals(null, mutex))
            {
                var error = $"Parameter mutex cannot be null. Use {nameof(LockResult)}.{nameof(Empty)} instead.";
                throw new ArgumentNullException(nameof(mutex), error);
            }

            return new LockResult(mutex);
        }
示例#2
0
 public async Task UnlockAsync(Mutex lockObject)
 {
     await UnlockInstance(lockObject.Resource, lockObject.Value);
 }
示例#3
0
 public void Unlock(Mutex mutex)
 {
     UnlockAsync(mutex).Wait();
 }
示例#4
0
 private LockResult(Mutex mutex)
 {
     Mutex = mutex;
 }