140 |
|
* phaser.arriveAndDeregister(); // deregister self, don't wait |
141 |
|
* }}</pre> |
142 |
|
* |
143 |
< |
* <p> To create a set of tasks using a tree of phasers, |
143 |
> |
* <p>To create a set of tasks using a tree of phasers, |
144 |
|
* you could use code of the following form, assuming a |
145 |
|
* Task class with a constructor accepting a phaser that |
146 |
|
* it registers for upon construction: |
712 |
|
* termination state, and subsequent calls to {@link #isTerminated} |
713 |
|
* will return true. |
714 |
|
* |
715 |
< |
* <p> The default version returns {@code true} when the number of |
715 |
> |
* <p>The default version returns {@code true} when the number of |
716 |
|
* registered parties is zero. Normally, overrides that arrange |
717 |
|
* termination for other reasons should also preserve this |
718 |
|
* property. |
719 |
|
* |
720 |
< |
* <p> You may override this method to perform an action with side |
720 |
> |
* <p>You may override this method to perform an action with side |
721 |
|
* effects visible to participating tasks, but it is in general |
722 |
|
* only sensible to do so in designs where all parties register |
723 |
|
* before any arrive, and all {@link #awaitAdvance} at each phase. |