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 } }