Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
        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();
            }
        }