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

final void scala::actors::FJTaskRunner::coInvoke ( final FJTask  w,
final FJTask  v 
) [inline, protected]

A specialized expansion of w.fork(); invoke(v); w.join();

Definition at line 886 of file FJTaskRunner.java.

References base, COLLECT_STATS, deq, scala::actors::FJTask::isDone(), pop(), put(), runs, scan(), scala::actors::FJTask::setDone(), slowCoInvoke(), and top.

Referenced by scala::actors::FJTask::coInvoke().

                                                                {

    // inline  push

    int t = top;
    if (t < (base & (deq.length-1)) + deq.length) {

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

      // inline  invoke

      if (!v.isDone()) { 
        if (COLLECT_STATS) ++runs; 
        v.run(); 
        v.setDone(); 
      }
      
      // inline  taskJoin
      
      while (!w.isDone()) {
        FJTask task  = pop();
        if (task != null) {
          if (!task.isDone()) {
            if (COLLECT_STATS) ++runs;
            task.run(); 
            task.setDone(); 
            if (task == w) return; // fast exit if we just ran w
          }
        }
        else
          scan(w);
      }
    }

    else      // handle non-inlinable cases
      slowCoInvoke(w, v);
  }


Generated by  Doxygen 1.6.0   Back to index