38 |
|
* |
39 |
|
* try { |
40 |
|
* barrier.await(); |
41 |
+ |
* } catch (InterruptedException ex) { |
42 |
+ |
* return; |
43 |
+ |
* } catch (BrokenBarrierException ex) { |
44 |
+ |
* return; |
45 |
|
* } |
42 |
– |
* catch (InterruptedException ex) { return; } |
43 |
– |
* catch (BrokenBarrierException ex) { return; } |
46 |
|
* } |
47 |
|
* } |
48 |
|
* } |
162 |
|
if (barrierCommand != null) |
163 |
|
barrierCommand.run(); |
164 |
|
return 0; |
165 |
< |
} |
164 |
< |
catch (RuntimeException ex) { |
165 |
> |
} catch (RuntimeException ex) { |
166 |
|
broken = generation; // next generation is broken |
167 |
|
throw ex; |
168 |
|
} |
174 |
|
trip.await(); |
175 |
|
else if (nanos > 0) |
176 |
|
nanos = trip.awaitNanos(nanos); |
177 |
< |
} |
177 |
< |
catch (InterruptedException ex) { |
177 |
> |
} catch (InterruptedException ex) { |
178 |
|
// Only claim that broken if interrupted before reset |
179 |
|
if (generation == g) { |
180 |
|
broken = g; |
181 |
|
trip.signalAll(); |
182 |
|
throw ex; |
183 |
< |
} |
184 |
< |
else { |
183 |
> |
} else { |
184 |
|
Thread.currentThread().interrupt(); // propagate |
185 |
|
break; |
186 |
|
} |
198 |
|
} |
199 |
|
return index; |
200 |
|
|
201 |
< |
} |
203 |
< |
finally { |
201 |
> |
} finally { |
202 |
|
lock.unlock(); |
203 |
|
} |
204 |
|
} |
298 |
|
public int await() throws InterruptedException, BrokenBarrierException { |
299 |
|
try { |
300 |
|
return dowait(false, 0); |
301 |
< |
} |
304 |
< |
catch (TimeoutException toe) { |
301 |
> |
} catch (TimeoutException toe) { |
302 |
|
throw new Error(toe); // cannot happen; |
303 |
|
} |
304 |
|
} |
371 |
|
lock.lock(); |
372 |
|
try { |
373 |
|
return broken >= generation; |
374 |
< |
} |
378 |
< |
finally { |
374 |
> |
} finally { |
375 |
|
lock.unlock(); |
376 |
|
} |
377 |
|
} |
392 |
|
nextGeneration(); |
393 |
|
broken = g; // cause brokenness setting to stop at previous gen. |
394 |
|
trip.signalAll(); |
395 |
< |
} |
400 |
< |
finally { |
395 |
> |
} finally { |
396 |
|
lock.unlock(); |
397 |
|
} |
398 |
|
} |
407 |
|
lock.lock(); |
408 |
|
try { |
409 |
|
return parties - count; |
410 |
< |
} |
416 |
< |
finally { |
410 |
> |
} finally { |
411 |
|
lock.unlock(); |
412 |
|
} |
413 |
|
} |