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

final void scala::actors::FJTaskRunner::push ( final FJTask  r  )  [inline]

Push a task onto DEQ. Called ONLY by current thread.

Definition at line 396 of file FJTaskRunner.java.

References base, deq, put(), slowPush(), and top.

Referenced by scala::actors::FJTask::fork(), slowCoInvoke(), and slowPush().

                                                         {
    int t = top;

    /*
      This test catches both overflows and index wraps.  It doesn't
      really matter if base value is in the midst of changing in take. 
      As long as deq length is < 2^30, we are guaranteed to catch wrap in
      time since base can only be incremented at most length times
      between pushes (or puts). 
    */

    if (t < (base & (deq.length-1)) + deq.length) {

      deq[t & (deq.length-1)].put(r);
      top = t + 1;
    }

    else  // isolate slow case to increase chances push is inlined
      slowPush(r); // check overflow and retry
  }


Generated by  Doxygen 1.6.0   Back to index