コード例 #1
0
        public void Unlock()
        {
            if (IsDisposed() || id == null)
            {
                return;
            }

            try
            {
                Zookeeper.Delete(id, -1);
            }
            catch (ThreadInterruptedException e)
            {
                Thread.CurrentThread.Interrupt();
            }
            catch (KeeperException.NoNodeException e)
            {
                //do nothing
            }
            catch (KeeperException e)
            {
                LOG.Warn("Caught: " + e, e);
                throw;
            }
            finally
            {
                OnLockReleased();
                id = null;
            }
        }
コード例 #2
0
ファイル: WriteLock.cs プロジェクト: wangyanjun/zookeeper
        public void Unlock()
        {
            if (IsDisposed() || id == null)
            {
                return;
            }

            try
            {
                Zookeeper.Delete(id, -1);
            }
            catch (ThreadInterruptedException)
            {
#if NET451
                Thread.CurrentThread.Interrupt();
#endif
            }
            catch (KeeperException.NoNodeException)
            {
                //do nothing
            }
            catch (KeeperException e)
            {
                LOG.WarnFormat("Caught: {0} {1}", e, e.StackTrace);
                throw;
            }
            finally
            {
                OnLockReleased();
                id = null;
            }
        }
コード例 #3
0
        public void Close()
        {
            IsOwner = false;

            Zookeeper.Delete(id, -1);
        }