/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> public void Dispose() { lock (this) { if (!Disposed) { Disposed = true; GC.SuppressFinalize(this); _resourceLock?.Unlock(); _resourceLock?.Dispose(); _resourceLock = null; } } }
/// <summary> /// Initializes a new instance of the <see cref="QuickMutexResourceLock"/> class. /// </summary> /// <param name="name">The name.</param> /// <param name="rType">Type of the r.</param> public QuickMutexResourceLock(string name, MutexResourceLockType rType = MutexResourceLockType.Global) { Disposed = false; _resourceLock = new MutexResourceLock(name, rType); _resourceLock.Lock(); }