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.

Get Java 9 Concurrency Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.