83 |
|
/* |
84 |
|
* Overview: |
85 |
|
* |
86 |
< |
* 1. Non-nullness of field result (set via CAS) indicates |
87 |
< |
* done. An AltResult is used to box null as a result, as well as |
88 |
< |
* to hold exceptions. Using a single field makes completion fast |
86 |
> |
* 1. Non-nullness of field result (set via CAS) indicates done. |
87 |
> |
* An AltResult is used to box null as a result, as well as to |
88 |
> |
* hold exceptions. Using a single field makes completion fast |
89 |
|
* and simple to detect and trigger, at the expense of a lot of |
90 |
|
* encoding and decoding that infiltrates many methods. One minor |
91 |
|
* simplification relies on the (static) NIL (to box null results) |
287 |
|
else if (q.thread != null && result == null) { |
288 |
|
try { |
289 |
|
ForkJoinPool.managedBlock(q); |
290 |
< |
} catch(InterruptedException ex){ |
290 |
> |
} catch (InterruptedException ex) { |
291 |
|
q.interruptControl = -1; |
292 |
|
} |
293 |
|
} |
320 |
|
if (nanos <= 0L) |
321 |
|
throw new TimeoutException(); |
322 |
|
long d = System.nanoTime() + nanos; |
323 |
< |
q = new WaitNode(true, nanos, d == 0L? 1L : d); // avoid 0 |
323 |
> |
q = new WaitNode(true, nanos, d == 0L ? 1L : d); // avoid 0 |
324 |
|
} |
325 |
|
else if (!queued) |
326 |
|
queued = UNSAFE.compareAndSwapObject(this, WAITERS, |
338 |
|
else if (q.thread != null && result == null) { |
339 |
|
try { |
340 |
|
ForkJoinPool.managedBlock(q); |
341 |
< |
} catch(InterruptedException ex){ |
341 |
> |
} catch (InterruptedException ex) { |
342 |
|
q.interruptControl = -1; |
343 |
|
} |
344 |
|
} |