BloombergLP::bslmt::TimedSemaphoreImpl<Platform::PthreadTimedSemaphore>::timedWait

Block until this semaphore can be acquired or absTime expires.

Synopsis

Declared in <bslmt_timedsemaphoreimpl_pthread.h>

int
timedWait(bsls::TimeInterval const& absTime);

Description

Block until the count of this semaphore is a positive value, or until the specified absTime timeout expires. 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 documentation). If the absTime timeout did not expire before the count attained a positive value, atomically decrement the count and return 0; otherwise, return a non-zero value with no effect on the count.

Return Value

0 if acquired before timeout, or a non-zero value if the timeout expired

Parameters

NameDescription
absTimeabsolute timeout from the construction clock epoch