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

final synchronized void scala::actors::FJTaskRunner::put ( final FJTask  r  )  [inline, protected]

Enqueue task at base of DEQ. Called ONLY by current thread. This method is currently not called from class FJTask. It could be used as a faster way to do FJTask.start, but most users would find the semantics too confusing and unpredictable.

Definition at line 436 of file FJTaskRunner.java.

References base, checkOverflow(), deq, scala::actors::FJTaskRunner::VolatileTaskRef::put(), and top.

Referenced by coInvoke(), and push().

                                                        {
    for (;;) {
      int b = base - 1;
      if (top < b + deq.length) {
        
        int newBase = b & (deq.length-1);
        deq[newBase].put(r);
        base = newBase;
        
        if (b != newBase) { // Adjust for index underflow
          int newTop = top & (deq.length-1);
          if (newTop < newBase) newTop += deq.length;
          top = newTop;
        }
        return;
      }
      else {
        checkOverflow();
        // ... and retry
      }
    }
  }


Generated by  Doxygen 1.6.0   Back to index