Flashcards in Phaser Class Deck (10):
Constructor that creates a Phaser object with no registered parties and no parents. The initial phase is set to zero. Has an overloaded version that takes the number of threads that need to arrive to advance to the next stage.
Phaser(), Phaser(int numThreads)
Adds a new thread to this Phaser object. Returns the phase current number. Throws an IllegalStateException if the maximum supported parties are already registered.
Adds numThreads of unarrived parties to this phaser object. Returns the current phase number. Throws an IllegalStateException if maximum supported parties are already registerd.
int bulkRegister(int numThreads)
Arrives at this phase without waiting for other threads to arrive. Returns the arrival phase number. Can throw an IllegalStateException.
Same as arrive() but also deregisters from the phaser object.
Arrives at this phase and blocks until other threads arrive.
Blocks until this Phaser object advances to the given phase value.
int awaitAdvance(int phase)
Returns the number of threads (parties) registered with this phaser object.
Returns the number of threads (parties) arrived at the current phase of the Phaser object.