Arrive and block until the required number of arrivals have occurred, or until the specified absTime timeout expires. In the former case, signal all the threads that are currently waiting on this barrier to unblock, reset the state of this barrier to its initial state, and return 0. If this method times out before the required number of arrivals, the thread is released to proceed and ceases to contribute to the number of arrivals, and e_TIMED_OUT is returned. Any other return value indicates that an error has occurred. Errors are unrecoverable. After an error, the barrier may be destroyed, but any other use has undefined behavior. absTime is an absolute time represented as an interval from some epoch, which is determined by the clock indicated at construction (see {Supported Clock‐Types} in the component‐level documentation). Note that timedWait and wait should not generally be used together; if one or more threads called wait while others called timedWait, then if the thread(s) that called timedWait were to time out and not retry, the threads that called wait would never unblock.
Synopsis
Declared in <bslmt_barrier.h>
int
timedWait(bsls::TimeInterval const& absTime);
Created with MrDocs