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 |
|
} |
2644 |
|
* completed. This method is designed for use only in error |
2645 |
|
* recovery actions, and even in such situations may result in |
2646 |
|
* ongoing dependent completions using established versus |
2647 |
< |
* overwritten values. |
2647 |
> |
* overwritten outcomes. |
2648 |
|
* |
2649 |
|
* @param value the completion value |
2650 |
|
*/ |
2653 |
|
postComplete(); |
2654 |
|
} |
2655 |
|
|
2656 |
+ |
/** |
2657 |
+ |
* Forcibly causes subsequent invocations of method get() and |
2658 |
+ |
* related methods to throw the given exception, whether or not |
2659 |
+ |
* already completed. This method is designed for use only in |
2660 |
+ |
* recovery actions, and even in such situations may result in |
2661 |
+ |
* ongoing dependent completions using established versus |
2662 |
+ |
* overwritten outcomes. |
2663 |
+ |
* |
2664 |
+ |
* @param ex the exception |
2665 |
+ |
*/ |
2666 |
+ |
public void obtrudeException(Throwable ex) { |
2667 |
+ |
if (ex == null) throw new NullPointerException(); |
2668 |
+ |
result = new AltResult(ex); |
2669 |
+ |
postComplete(); |
2670 |
+ |
} |
2671 |
+ |
|
2672 |
|
// Unsafe mechanics |
2673 |
|
private static final sun.misc.Unsafe UNSAFE; |
2674 |
|
private static final long RESULT; |