/** * Stripped-down variant of awaitJoin used by timed joins. Tries * to help join only while there is continuous progress. (Caller * will then enter a timed wait.) * * @param joiner the joining worker * @param task the task */ final void helpJoinOnce(WorkQueue joiner, ForkJoinTask<?> task) { int s; if (joiner != null && task != null && (s = task.status) >= 0) { ForkJoinTask<?> prevJoin = joiner.currentJoin; joiner.currentJoin = task; do {} while (joiner.tryRemoveAndExec(task) && // process local tasks (s = task.status) >= 0); if (s >= 0) { if (task instanceof CountedCompleter) helpComplete(joiner, (CountedCompleter<?>)task); do {} while (task.status >= 0 && tryHelpStealer(joiner, task) > 0); } joiner.currentJoin = prevJoin; } }
(s = task.status) >= 0); if (s >= 0 && (task instanceof CountedCompleter)) s = helpComplete(joiner, (CountedCompleter<?>)task); long cc = 0; // for stability checks while (s >= 0 && (s = task.status) >= 0) {