public void Dispose(bool disposing) { try { ConfigLock.EnterWriteLock(); if (!Disposed && disposing) { GC.SuppressFinalize(this); } if (_heartBeat != null) { _heartBeat.Dispose(); } foreach (var configObserver in ConfigObservers) { UnRegisterObserver(configObserver.Value); } ConfigObservers.Clear(); Disposed = true; } finally { ConfigLock.ExitWriteLock(); } }
public void Dispose(bool disposing) { if (!Disposed && disposing) { GC.SuppressFinalize(this); } foreach (var configObserver in ConfigObservers) { UnRegisterObserver(configObserver.Value); } ConfigObservers.Clear(); Disposed = true; }
public void Dispose(bool disposing) { lock (SyncObj) { if (!Disposed && disposing) { GC.SuppressFinalize(this); } if (_heartBeat != null) { _heartBeat.Dispose(); } foreach (var configObserver in ConfigObservers) { UnRegisterObserver(configObserver.Value); } ConfigObservers.Clear(); Disposed = true; } }
public void Dispose(bool disposing) { try { ConfigLock.EnterWriteLock(); { if (!_disposed && disposing) { GC.SuppressFinalize(this); } foreach (var configObserver in ConfigObservers) { UnRegisterObserver(configObserver.Value); } ConfigObservers.Clear(); _threads.Clear(); _disposed = true; } } finally { ConfigLock.ExitWriteLock(); } }