100 |
|
* #getRegisteredParties} parties in total, of which {@link |
101 |
|
* #getArrivedParties} have arrived at the current phase ({@link |
102 |
|
* #getPhase}). When the remaining ({@link #getUnarrivedParties}) |
103 |
< |
* parties arrive, the phase advances; thus, this value is always |
104 |
< |
* greater than zero if there are any registered parties. The values |
105 |
< |
* returned by these methods may reflect transient states and so are |
106 |
< |
* not in general useful for synchronization control. Method {@link |
107 |
< |
* #toString} returns snapshots of these state queries in a form |
108 |
< |
* convenient for informal monitoring. |
103 |
> |
* parties arrive, the phase advances. The values returned by these |
104 |
> |
* methods may reflect transient states and so are not in general |
105 |
> |
* useful for synchronization control. Method {@link #toString} |
106 |
> |
* returns snapshots of these state queries in a form convenient for |
107 |
> |
* informal monitoring. |
108 |
|
* |
109 |
|
* <p><b>Sample usages:</b> |
110 |
|
* |
763 |
|
|
764 |
|
/** |
765 |
|
* Overridable method to perform an action upon phase advance, and |
766 |
< |
* to control termination. This method is invoked whenever the |
767 |
< |
* barrier is tripped (and thus all other waiting parties are |
768 |
< |
* dormant). If it returns {@code true}, then, rather than advance |
769 |
< |
* the phase number, this barrier will be set to a final |
770 |
< |
* termination state, and subsequent calls to {@link #isTerminated} |
771 |
< |
* will return true. |
766 |
> |
* to control termination. This method is invoked upon arrival of |
767 |
> |
* the party tripping the barrier (when all other waiting parties |
768 |
> |
* are dormant). If this method returns {@code true}, then, |
769 |
> |
* rather than advance the phase number, this barrier will be set |
770 |
> |
* to a final termination state, and subsequent calls to {@link |
771 |
> |
* #isTerminated} will return true. Any (unchecked) Exception or |
772 |
> |
* Error thrown by an invocation of this method is propagated to |
773 |
> |
* the party attempting to trip the barrier, in which case no |
774 |
> |
* advance occurs. |
775 |
> |
* |
776 |
> |
* <p>The arguments to this method provide the state of the phaser |
777 |
> |
* prevailing for the current transition. (When called from within |
778 |
> |
* an implementation of {@code onAdvance} the values returned by |
779 |
> |
* methods such as {@code getPhase} may or may not reliably |
780 |
> |
* indicate the state to which this transition applies.) |
781 |
|
* |
782 |
|
* <p>The default version returns {@code true} when the number of |
783 |
|
* registered parties is zero. Normally, overrides that arrange |