Exemple #1
0
 /** 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;
 }
Exemple #2
0
 /**
  * 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();
   }
 }
Exemple #3
0
 /**
  * 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();
   }
 }