BloombergLP::bslmt::Latch::Latch

Create a latch that synchronizes on the specified count events.

Synopsis

Declared in <bslmt_latch.h>

explicit
Latch(
    int count,
    bsls::SystemClockType::Enum clockType = bsls::SystemClockType::e_REALTIME);

Description

Create a latch that will synchronize on the specified count number of events, and when count events have been recorded will release any waiting threads. Optionally specify a clockType indicating the type of the system clock against which the bsls::TimeInterval absTime timeouts passed to the timedWait method are to be interpreted. If clockType is not specified then the realtime system clock is used. The behavior is undefined unless 0 <= count.

Parameters

NameDescription
countnumber of events required to release the latch
clockTypeclock used to interpret timedWait timeouts