This class defines a thread synchronization mechanism that allows one or more threads to wait until a certain number of operations have been performed by other threads.
Synopsis
Declared in <bslmt_latch.h>
class Latch;
Enums
Name |
Description |
Status codes for timed wait operations. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this latch. The behavior is undefined if any threads are waiting on this latch. |
Decrement the number of events that this latch is waiting for by 1, and if the resulting number of events is 0 release any waiting threads. The behavior is undefined unless the sum of all events that have arrived at this latch does not exceed the count with which it was initialized. Note that the initial count of events is supplied at construction. |
|
Decrement the number of events that this latch is waiting for by 1, and if the resulting number of events is 0 release any waiting threads; otherwise, block until the required number of events has been reached. The behavior is undefined unless the sum of all events that have arrived at this latch does not exceed the count with which it was initialized. Note that the initial count of events is supplied at construction. Also note that this method is equivalent to the following sequence: ` arrive(); wait(); ` |
|
Return the clock type used for timeouts. |
|
Decrement the number of events that this latch is waiting for by the specified |
|
Return the current number of events for which this latch is waiting. Note that this method is provided primarily for debugging purposes (i.e., its intended use is not as a synchronization mechanism), and can be used only as an upper bound for the current count without other external state information. |
|
|
|
Return |
|
Block until the number of events that this latch is waiting for reaches 0. Note that completion of this method does not guarantee this object is safe to destroy. |
Created with MrDocs