O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

There's more...

The Phaser class provides other methods related to the change of phase. These methods are as follows:

  • arrive(): This method notifies the Phaser class that one participant has finished the actual phase but it should not wait for the rest of the participants to continue with their execution. Be careful with the utilization of this method because it doesn't synchronize with other threads.
  • awaitAdvance(int phase): This method puts the current thread to sleep until all the participants of the phaser parameter have finished the current phase, that is, if the number we pass as the parameter is equal to the actual phase of phaser. If the parameter and the actual phase of phaser aren't equal, the method  ends its execution.
  • awaitAdvanceInterruptibly(int ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required