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