Example #1
0
        /** <inheritDoc /> */
        public void Dispose()
        {
            lock (this)
            {
                ThrowIfDisposed();

                if (_state > 0 || _counter > 0)
                {
                    throw new SynchronizationLockException(
                              "The lock is being disposed while still being used. " +
                              "It either is being held by a thread and/or has active waiters waiting to acquire the lock.");
                }

                UU.CacheCloseLock(_cache, _id);

                _state = -1;

                GC.SuppressFinalize(this);
            }
        }