protected synchronized WaitQueue.WaitNode getSignallee(Thread caller) { if (caller != owner_) throw new IllegalMonitorStateException("Not owner"); // assert (holds_ > 0) if (holds_ >= 2) { // current thread will keep the lock --holds_; return null; } // assert (holds_ == 1) WaitQueue.WaitNode w = wq_.extract(); if (w == null) { // if none, clear for new arrivals owner_ = null; holds_ = 0; } return w; }