BloombergLP::bslmt::SemaphoreImpl<Platform::PosixSemaphore>

This class provides a full specialization of SemaphoreImpl for pthreads. The implementation provided here defines an efficient proxy for the sem_t pthread type, and related operations.

Synopsis

Declared in <bslmt_semaphoreimpl_pthread.h>

template<>
class SemaphoreImpl<Platform::PosixSemaphore>;

Member Functions

NameDescription
SemaphoreImpl [constructor]Create a semaphore initialized to the specified count. This method does not return normally unless there are sufficient system resources to construct the object.
~SemaphoreImpl [destructor]Destroy a semaphore
getValue Return the current value of this semaphore.
post post overloads
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 of this semaphore is a positive value and atomically decrement it.