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

Broken CyclicBarrier objects

A CyclicBarrier object can be in a special state denoted by the broken state. When there are various threads waiting in the await() method and one of them is interrupted, the one that is interrupted receives an InterruptedException exception, but other threads receive a BrokenBarrierException exception; CyclicBarrier is placed in the broken state.

The CyclicBarrier class provides the isBroken() method. It returns true if the object is in the broken state; otherwise, it returns false.

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