Beispiel #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);
        }
Beispiel #2
0
 public async Task UnlockAsync(Mutex lockObject)
 {
     await UnlockInstance(lockObject.Resource, lockObject.Value);
 }
Beispiel #3
0
 public void Unlock(Mutex mutex)
 {
     UnlockAsync(mutex).Wait();
 }
Beispiel #4
0
 private LockResult(Mutex mutex)
 {
     Mutex = mutex;
 }