This class implements a portable semaphore type for thread synchronization.
Declared in <bslmt_timedsemaphoreimpl_pthread.h>
template<>
class TimedSemaphoreImpl<Platform::PthreadTimedSemaphore>;
| Name | Description |
|---|---|
Unnamed enum | The value timedWait returns when a timeout occurs. |
| Name | Description |
|---|---|
TimedSemaphoreImpl [constructor] | Constructors |
~TimedSemaphoreImpl [destructor] | Destroy this semaphore object. |
clockType | Return the clock type used for timeouts. |
post | post overloads |
timedWait | 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. |
tryWait | Decrement the count of this semaphore if it is positive and return 0. Return a non-zero value otherwise. |
wait | Block until the count is a positive value and atomically decrement it. |