/** Same as signalShared, except returns false if queue is empty. */ boolean signalNextShared() { Node head = mHead; if (head == null) { return false; } if (head instanceof Shared) { head.signal(); } return true; }
/** * Signals the first waiter if it is a shared waiter. Exclusive latch must be held, which is still * held when method returns. */ void signalShared() { Node head = mHead; if (head instanceof Shared) { head.signal(); } }
/** * Signals the first waiter, unless queue is empty. Exclusive latch must be held, which is still * held when method returns. */ void signal() { Node head = mHead; if (head != null) { head.signal(); } }