private volatile bool _disposedValue = false; // To detect redundant calls private void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { try { AsyncMutex.ReleaseLock(); } catch (Exception ex) { Logger.LogWarning(ex); } } AsyncMutex = null; _disposedValue = true; } }
/// <summary> /// Creates the key for a mutex. /// </summary> /// <param name="asyncMutex">The mutex to release. May not be <c>null</c>.</param> public Key(AsyncMutex asyncMutex) { AsyncMutex = asyncMutex; }