This class defines a thread barrier.

Synopsis

Declared in <bslmt_barrier.h>

class Barrier;

Enums

Name

Description

Unnamed enum

Status codes for timed wait operations.

Member Functions

Name

Description

Barrier [constructor]

Constructors

~Barrier [destructor]

Wait for all signaled threads to unblock and destroy this barrier. (See wait and timedWait below for the meaning of signaled.) Note that the behavior is undefined if a barrier is destroyed while one or more threads are waiting on it.

arrive

Arrive on this barrier. If this is the last required arrival, signal all the threads that are currently waiting on this barrier to unblock and reset the state of this barrier to its initial state.

clockType

Return the clock type used for timeouts.

numArrivals

Return the required number of arrivals before all waiting threads will unblock.

numThreads

Return the required number of arrivals before all waiting threads will unblock.

timedWait

timedWait overloads

wait

Arrive and block until the required number of arrivals have occurred. Then signal all the threads that are currently waiting on this barrier to unblock and reset the state of this barrier to its initial state. Note that generally wait and timedWait should not be used together, for reasons explained in the documentation of timedWait.

Created with MrDocs