140 |
|
/** |
141 |
|
* Main barrier code, covering the various policies. |
142 |
|
*/ |
143 |
< |
private int dowait(boolean timed, long nanos) throws InterruptedException, BrokenBarrierException, TimeoutException { |
143 |
> |
private int dowait(boolean timed, long nanos) |
144 |
> |
throws InterruptedException, BrokenBarrierException, TimeoutException { |
145 |
|
lock.lock(); |
146 |
|
try { |
147 |
|
int index = --count; |
167 |
|
broken = generation; // next generation is broken |
168 |
|
throw ex; |
169 |
|
} |
170 |
+ |
catch (Error ex) { |
171 |
+ |
broken = generation; // next generation is broken |
172 |
+ |
throw ex; |
173 |
+ |
} |
174 |
|
} |
175 |
|
|
176 |
|
while (generation == g) { |
362 |
|
* interrupted while the current thread was waiting, or the barrier was |
363 |
|
* reset, or the barrier was broken when <tt>await</tt> was called. |
364 |
|
*/ |
365 |
< |
public int await(long timeout, TimeUnit unit) throws InterruptedException, BrokenBarrierException, TimeoutException { |
365 |
> |
public int await(long timeout, TimeUnit unit) |
366 |
> |
throws InterruptedException, |
367 |
> |
BrokenBarrierException, |
368 |
> |
TimeoutException { |
369 |
|
return dowait(true, unit.toNanos(timeout)); |
370 |
|
} |
371 |
|
|
421 |
|
} |
422 |
|
|
423 |
|
} |
416 |
– |
|
417 |
– |
|