Logo Search packages:      
Sourcecode: scala version File versions  Download package

final synchronized FJTask scala::actors::FJTaskRunner::confirmPop ( int  provisionalTop  )  [inline, protected]

Check under synch lock if DEQ is really empty when doing pop. Return task if not empty, else null.

Definition at line 501 of file FJTaskRunner.java.

References base, deq, take(), and top.

Referenced by pop().

                                                                     {
    if (base <= provisionalTop) 
      return deq[provisionalTop & (deq.length-1)].take();
    else {    // was empty
      /*
        Reset DEQ indices to zero whenever it is empty.
        This both avoids unnecessary calls to checkOverflow
        in push, and helps keep the DEQ from accumulating garbage
      */

      top = base = 0;
      return null;
    }
  }


Generated by  Doxygen 1.6.0   Back to index