55 |
|
* minimize other blocking synchronization apart from joining other |
56 |
|
* tasks or using synchronizers such as Phasers that are advertised to |
57 |
|
* cooperate with fork/join scheduling. Subdividable tasks should also |
58 |
< |
* not perform blocking IO, and should ideally access variables that |
58 |
> |
* not perform blocking I/O, and should ideally access variables that |
59 |
|
* are completely independent of those accessed by other running |
60 |
|
* tasks. These guidelines are loosely enforced by not permitting |
61 |
|
* checked exceptions such as {@code IOExceptions} to be |
73 |
|
* <p>It is possible to define and use ForkJoinTasks that may block, |
74 |
|
* but doing do requires three further considerations: (1) Completion |
75 |
|
* of few if any <em>other</em> tasks should be dependent on a task |
76 |
< |
* that blocks on external synchronization or IO. Event-style async |
76 |
> |
* that blocks on external synchronization or I/O. Event-style async |
77 |
|
* tasks that are never joined (for example, those subclassing {@link |
78 |
|
* CountedCompleter}) often fall into this category. (2) To minimize |
79 |
|
* resource impact, tasks should be small; ideally performing only the |
435 |
|
} |
436 |
|
|
437 |
|
/** |
438 |
< |
* Records exception and possibly propagates |
438 |
> |
* Records exception and possibly propagates. |
439 |
|
* |
440 |
|
* @return status on exit |
441 |
|
*/ |
978 |
|
if (Thread.interrupted()) |
979 |
|
throw new InterruptedException(); |
980 |
|
// Messy in part because we measure in nanosecs, but wait in millisecs |
981 |
< |
int s; long ns, ms; |
982 |
< |
if ((s = status) >= 0 && (ns = unit.toNanos(timeout)) > 0L) { |
981 |
> |
int s; long ms; |
982 |
> |
long ns = unit.toNanos(timeout); |
983 |
> |
if ((s = status) >= 0 && ns > 0L) { |
984 |
|
long deadline = System.nanoTime() + ns; |
985 |
|
ForkJoinPool p = null; |
986 |
|
ForkJoinPool.WorkQueue w = null; |
1501 |
|
} |
1502 |
|
} |
1503 |
|
} |
1504 |
+ |
|
1505 |
|
} |