185 |
|
|
186 |
|
int index = --count; |
187 |
|
if (index == 0) { // tripped |
188 |
< |
boolean ranAction = false; |
189 |
< |
try { |
190 |
< |
final Runnable command = barrierCommand; |
191 |
< |
if (command != null) |
188 |
> |
Runnable command = barrierCommand; |
189 |
> |
if (command != null) { |
190 |
> |
try { |
191 |
|
command.run(); |
192 |
< |
ranAction = true; |
194 |
< |
nextGeneration(); |
195 |
< |
return 0; |
196 |
< |
} finally { |
197 |
< |
if (!ranAction) |
192 |
> |
} catch (Throwable ex) { |
193 |
|
breakBarrier(); |
194 |
+ |
throw ex; |
195 |
+ |
} |
196 |
|
} |
197 |
+ |
nextGeneration(); |
198 |
+ |
return 0; |
199 |
|
} |
200 |
|
|
201 |
|
// loop until tripped, broken, interrupted, or timed out |