216 |
|
} |
217 |
|
|
218 |
|
/** |
219 |
< |
* arrive() returns a negative number if the Phaser is termindated |
219 |
> |
* arrive() returns a negative number if the Phaser is terminated |
220 |
|
*/ |
221 |
|
public void testArrive3() { |
222 |
|
Phaser phaser = new Phaser(1); |
227 |
|
|
228 |
|
/** |
229 |
|
* arriveAndDeregister() throws IllegalStateException if number of |
230 |
< |
* registered or unnarived parties would become negative |
230 |
> |
* registered or unarrived parties would become negative |
231 |
|
*/ |
232 |
|
public void testArriveAndDeregister1() { |
233 |
|
try { |
240 |
|
} |
241 |
|
|
242 |
|
/** |
243 |
< |
* arriveAndDeregister derigisters reduces the number of arrived parties |
243 |
> |
* arriveAndDeregister deregisters reduces the number of arrived parties |
244 |
|
*/ |
245 |
|
public void testArriveAndDergeister2() { |
246 |
|
final Phaser phaser = new Phaser(1); |
424 |
|
* waits for the second thread's party to arrive |
425 |
|
*/ |
426 |
|
new Thread() { |
427 |
< |
|
427 |
> |
|
428 |
|
public void run() { |
429 |
|
getRunnable(SMALL_DELAY_MS).run(); |
430 |
|
int phase = phaser.awaitAdvance(phaser.arrive()); |
437 |
|
}.start(); |
438 |
|
/* |
439 |
|
* This thread will cause the first thread run to wait, in doing so |
440 |
< |
* the main thread will force termination in which the first thread |
441 |
< |
* should exit peacefully as this one |
440 |
> |
* the main thread will force termination in which the first thread |
441 |
> |
* should exit peacefully as this one |
442 |
|
*/ |
443 |
|
new Thread() { |
444 |
|
|