175 |
|
throw new InterruptedException(); |
176 |
|
} |
177 |
|
|
178 |
< |
int index = --count; |
179 |
< |
if (index == 0) { // tripped |
180 |
< |
boolean ranAction = false; |
181 |
< |
try { |
182 |
< |
final Runnable command = barrierCommand; |
183 |
< |
if (command != null) |
184 |
< |
command.run(); |
185 |
< |
ranAction = true; |
186 |
< |
nextGeneration(); |
187 |
< |
return 0; |
188 |
< |
} finally { |
189 |
< |
if (!ranAction) |
190 |
< |
breakBarrier(); |
191 |
< |
} |
192 |
< |
} |
178 |
> |
int index = --count; |
179 |
> |
if (index == 0) { // tripped |
180 |
> |
boolean ranAction = false; |
181 |
> |
try { |
182 |
> |
final Runnable command = barrierCommand; |
183 |
> |
if (command != null) |
184 |
> |
command.run(); |
185 |
> |
ranAction = true; |
186 |
> |
nextGeneration(); |
187 |
> |
return 0; |
188 |
> |
} finally { |
189 |
> |
if (!ranAction) |
190 |
> |
breakBarrier(); |
191 |
> |
} |
192 |
> |
} |
193 |
|
|
194 |
|
// loop until tripped, broken, interrupted, or timed out |
195 |
|
for (;;) { |