Java Phaser arrive() MethodThe arrive() method of Phaser class is used to notify the arrival of the current phaser, without waiting for the other phasers to arrive. Syntax:Return:It returns arrival of the current phaser number. Throws:IllegalStateException - this Exception is thrown when the number of unarrived parties is negative. Example 1Test it NowOutput: Thread is sleeping Thread-0 arrived Thread-2 arrived Thread-1 arrived Thread-3 arrived Thread-4 arrived Thread-5 arrived Final Phase count after arrival of Thread is 0 Example 2Test it NowOutput: Thread is sleeping Final Phase count after arrival of Thread is 0 Thread-1 arrived Thread-0 arrived Next TopicJava Phaser |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India