public void unlock() { Thread caller = Thread.currentThread(); for (;;) { WaitQueue.WaitNode w = getSignallee(caller); if (w == null) return; // no one to signal if (w.signal(this)) return; // notify if still waiting, else skip } }
public void unlock() { Thread caller = Thread.currentThread(); for (;;) { WaitQueue.WaitNode w = getSignallee(caller); if (w == null) return; // no one to signal if (w.signal(this)) return; // notify if still waiting, else skip } }
public void unlock() { Thread caller = Thread.currentThread(); for (;;) { WaitQueue.WaitNode w = getSignallee(caller); if (w == null) return; // no one to signal if (w.signal(this)) return; // notify if still waiting, else skip } }
public void signalAll() { if (!lock.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } for (;;) { WaitQueue.WaitNode w = wq.extract(); if (w == null) return; // no more to signal w.signal(sync); } }
public void signalAll() { if (!lock.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } for (;;) { WaitQueue.WaitNode w = wq.extract(); if (w == null) return; // no more to signal w.signal(sync); } }
public void signal() { if (!lock.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } for (;;) { WaitQueue.WaitNode w = wq.extract(); if (w == null) return; // no one to signal if (w.signal(sync)) return; // notify if still waiting, else skip } }
public void signal() { if (!lock.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } for (;;) { WaitQueue.WaitNode w = wq.extract(); if (w == null) return; // no one to signal if (w.signal(sync)) return; // notify if still waiting, else skip } }
public void signal() { if (!lock.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } for (;;) { WaitQueue.WaitNode w = wq.extract(); if (w == null) return; // no one to signal if (w.signal(sync)) return; // notify if still waiting, else skip } }
public void signalAll() { if (!lock.isHeldByCurrentThread()) { throw new IllegalMonitorStateException(); } for (;;) { WaitQueue.WaitNode w = wq.extract(); if (w == null) return; // no more to signal w.signal(sync); } }