Java Phaser getUnarrivedParties() Method

The getUnarrivedParties() Method is of Phaser Class. It returns the number of registered parties that have not yet arrived at the current phase of this phaser.

Syntax

Return

It returns the number of unarrived parties.

Example 1

Test it Now

Output:

Phasecount is 0
Thread-0 arrived
Thread-1 arrived
Thread-2 arrived
Thread-3 arrived
Unarrived Parties : 1
Thread-4 arrived
Thread-5 arrived
Phasecount is 0

Example 2

Test it Now

Output:

Phasecount is 0
Thread-0 arrived
Unarrived Parties : 1
Thread-1 arrived
Phasecount is 0

Next TopicJava Phaser




Latest Courses