public void lock() { Thread caller = Thread.currentThread(); synchronized (this) { if (owner_ == null) { owner_ = caller; holds_ = 1; return; } else if (caller == owner_) { incHolds(); return; } } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); n.doWaitUninterruptibly(this); }
public void lock() { Thread caller = Thread.currentThread(); synchronized (this) { if (owner_ == null) { owner_ = caller; holds_ = 1; return; } else if (caller == owner_) { incHolds(); return; } } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); n.doWaitUninterruptibly(this); }
public void lock() { Thread caller = Thread.currentThread(); synchronized (this) { if (owner_ == null) { owner_ = caller; holds_ = 1; return; } else if (caller == owner_) { incHolds(); return; } } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); n.doWaitUninterruptibly(this); }
public void awaitUninterruptibly() { int holdCount = lock.getHoldCount(); if (holdCount == 0) { throw new IllegalMonitorStateException(); } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); wq.insert(n); for (int i=holdCount; i>0; i--) lock.unlock(); try { n.doWaitUninterruptibly(sync); } finally { for (int i=holdCount; i>0; i--) lock.lock(); } }
public void awaitUninterruptibly() { int holdCount = lock.getHoldCount(); if (holdCount == 0) { throw new IllegalMonitorStateException(); } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); wq.insert(n); for (int i=holdCount; i>0; i--) lock.unlock(); try { n.doWaitUninterruptibly(sync); } finally { for (int i=holdCount; i>0; i--) lock.lock(); } }
public void awaitUninterruptibly() { int holdCount = lock.getHoldCount(); if (holdCount == 0) { throw new IllegalMonitorStateException(); } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); wq.insert(n); for (int i=holdCount; i>0; i--) lock.unlock(); try { n.doWaitUninterruptibly(sync); } finally { for (int i=holdCount; i>0; i--) lock.lock(); } }
public void acquireUninterruptibly(int n) { if (precheck(n)) return; WaitQueue.WaitNode w = new Node(n); w.doWaitUninterruptibly(this); }
public void acquireUninterruptibly(int n) { if (precheck(n)) return; WaitQueue.WaitNode w = new Node(n); w.doWaitUninterruptibly(this); }
public void acquireUninterruptibly(int n) { if (precheck(n)) return; WaitQueue.WaitNode w = new Node(n); w.doWaitUninterruptibly(this); }