Lines Matching defs:parties

50  * number of parties <em>registered</em> to synchronize on a phaser
53 * constructors establishing initial numbers of parties), and
67 * number starts at zero, and advances when all parties arrive at the
114 * parties to become zero. As illustrated below, when phasers control
123 * large numbers of parties that would otherwise experience heavy
131 * Whenever the number of registered parties of a child phaser becomes
135 * registered parties becomes zero as the result of an invocation of
140 * only by registered parties, the current state of a phaser may be
142 * #getRegisteredParties} parties in total, of which {@link
145 * parties arrive, the phase advances. The values returned by these
154 * to control a one-shot action serving a variable number of parties.
253 * maximum number of parties to 65535. Attempts to register additional
254 * parties result in {@code IllegalStateException}. However, you can and
271 * unarrived -- the number of parties yet to hit barrier (bits 0-15)
272 * parties -- the number of parties to wait (bits 16-31)
276 * Except that a phaser with no registered parties is
278 * parties and one unarrived parties (encoded as EMPTY below).
367 MAX_PARTIES + " parties for " + stateToString(s);
415 * @param registrations number to add to both parties and
426 int parties = counts >>> PARTIES_SHIFT;
428 if (registrations > MAX_PARTIES - parties)
468 * their own advance by setting unarrived to parties (or if
469 * parties is zero, resetting to unregistered EMPTY state).
471 * subphasers with possibly some unarrived parties are merely
482 // CAS root phase with current parties; possibly trip unarrived
497 * Creates a new phaser with no initially registered parties, no
507 * unarrived parties, no parent, and initial phase number 0.
509 * @param parties the number of parties required to advance to the
511 * @throws IllegalArgumentException if parties less than zero
512 * or greater than the maximum number of parties supported
514 public Phaser(int parties) {
515 this(null, parties);
529 * registered unarrived parties. When the given parent is non-null
530 * and the given number of parties is greater than zero, this
534 * @param parties the number of parties required to advance to the
536 * @throws IllegalArgumentException if parties less than zero
537 * or greater than the maximum number of parties supported
539 public Phaser(Phaser parent, int parties) {
540 if (parties >>> PARTIES_SHIFT != 0)
541 throw new IllegalArgumentException("Illegal number of parties");
549 if (parties != 0)
557 this.state = (parties == 0) ? (long)EMPTY :
559 ((long)parties << PARTIES_SHIFT) |
560 ((long)parties);
567 * a parent, and this phaser previously had no registered parties,
576 * than the maximum supported number of parties
583 * Adds the given number of new unarrived parties to this phaser.
586 * phaser has a parent, and the given number of parties is greater
588 * parties, this child phaser is also registered with its parent.
592 * @param parties the number of additional parties required to
598 * than the maximum supported number of parties
599 * @throws IllegalArgumentException if {@code parties < 0}
601 public int bulkRegister(int parties) {
602 if (parties < 0)
604 if (parties == 0)
606 return doRegister(parties);
619 * of unarrived parties would become negative
628 * parties required to advance in future phases. If this phaser
630 * zero parties, this phaser is also deregistered from its parent.
639 * of registered or unarrived parties would become negative
661 * of unarrived parties would become negative
797 * registered parties are unaffected. If this phaser is a member
833 * Returns the number of parties registered at this phaser.
835 * @return the number of parties
842 * Returns the number of registered parties that have arrived at
846 * @return the number of arrived parties
853 * Returns the number of registered parties that have not yet
857 * @return the number of unarrived parties
895 * waiting parties are dormant). If this method returns {@code
915 * number of registered parties has become zero as the result of a
923 * protected boolean onAdvance(int phase, int parties) { return false; }
928 * @param registeredParties the current number of registered parties
938 * "phase = "} followed by the phase number, {@code "parties = "}
939 * followed by the number of registered parties, and {@code
940 * "arrived = "} followed by the number of arrived parties.
954 " parties = " + partiesOf(s) +