Method: Concurrent::CyclicBarrier#broken?

Defined in:
lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb

#broken?Boolean

A barrier can be broken when:

  • a thread called the reset method while at least one other thread was waiting

  • at least one thread timed out on wait method

A broken barrier can be restored using reset it’s safer to create a new one

Returns:

  • (Boolean)

    true if the barrier is broken otherwise false



105
106
107
# File 'lib/concurrent-ruby/concurrent/atomic/cyclic_barrier.rb', line 105

def broken?
  synchronize { @generation.status != :waiting }
end