internal virtual void ReleaseCounter(Counter counter) { _clientLock.Lock(); try { if (!counter.IsClosed()) { counter.InternalClose(); EnsureOpen(); long registrationId = counter.RegistrationId(); AwaitResponse(_driverProxy.RemoveCounter(registrationId)); _resourceByRegIdMap.Remove(registrationId); } } finally { _clientLock.Unlock(); } }
internal void ReleaseCounter(Counter counter) { _clientLock.Lock(); try { if (!counter.IsClosed) { EnsureActive(); EnsureNotReentrant(); counter.InternalClose(); long registrationId = counter.RegistrationId; if (_resourceByRegIdMap.Remove(registrationId)) { AwaitResponse(_driverProxy.RemoveCounter(registrationId)); } } } finally { _clientLock.Unlock(); } }