102 |
|
* } |
103 |
|
* }.start(); |
104 |
|
* } |
105 |
+ |
* |
106 |
+ |
* doSomethingOnBehalfOfWorkers(); |
107 |
|
* phaser.arrive(); // allow threads to start |
108 |
< |
* int p = phaser.arriveAndDeregister(); // deregister self |
108 |
> |
* int p = phaser.arriveAndDeregister(); // deregister self ... |
109 |
> |
* p = phaser.awaitAdvance(p); // ... and await arrival |
110 |
|
* otherActions(); // do other things while tasks execute |
111 |
< |
* phaser.awaitAdvance(p); // wait for all tasks to arrive |
111 |
> |
* phaser.awaitAdvance(p); // awit final completion |
112 |
|
* } |
113 |
|
* </pre> |
114 |
|
* |