public boolean tryLock(long nanos) throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); Thread caller = Thread.currentThread(); synchronized (this) { if (owner_ == null) { owner_ = caller; holds_ = 1; return true; } else if (caller == owner_) { incHolds(); return true; } } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); return n.doTimedWait(this, nanos); }
public boolean tryLock(long nanos) throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); Thread caller = Thread.currentThread(); synchronized (this) { if (owner_ == null) { owner_ = caller; holds_ = 1; return true; } else if (caller == owner_) { incHolds(); return true; } } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); return n.doTimedWait(this, nanos); }
public void lockInterruptibly() throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); 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.doWait(this); }
public boolean tryLock(long nanos) throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); Thread caller = Thread.currentThread(); synchronized (this) { if (owner_ == null) { owner_ = caller; holds_ = 1; return true; } else if (caller == owner_) { incHolds(); return true; } } WaitQueue.WaitNode n = new WaitQueue.WaitNode(); return n.doTimedWait(this, nanos); }
public void lockInterruptibly() throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); 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.doWait(this); }
public void lockInterruptibly() throws InterruptedException { if (Thread.interrupted()) throw new InterruptedException(); 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.doWait(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 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 synchronized boolean recheck(WaitQueue.WaitNode node) { Thread caller = Thread.currentThread(); if (owner_ == null) { owner_ = caller; holds_ = 1; return true; } else if (caller == owner_) { incHolds(); return true; } wq_.insert(node); return false; }
public synchronized boolean recheck(WaitQueue.WaitNode node) { Thread caller = Thread.currentThread(); if (owner_ == null) { owner_ = caller; holds_ = 1; return true; } else if (caller == owner_) { incHolds(); return true; } wq_.insert(node); return false; }
public synchronized boolean recheck(WaitQueue.WaitNode node) { Thread caller = Thread.currentThread(); if (owner_ == null) { owner_ = caller; holds_ = 1; return true; } else if (caller == owner_) { incHolds(); return true; } wq_.insert(node); return false; }