8#ifndef INCLUDED_BSLMT_TIMEDSEMAPHOREIMPL_POSIXADV
9#define INCLUDED_BSLMT_TIMEDSEMAPHOREIMPL_POSIXADV
89#include <bslscm_version.h>
93#ifdef BSLMT_PLATFORM_POSIXADV_TIMEDSEMAPHORE
101#include <semaphore.h>
106template <
class TIMED_SEMAPHORE_POLICY>
107class TimedSemaphoreImpl;
118class TimedSemaphoreImpl<Platform::PosixAdvTimedSemaphore> {
128 TimedSemaphoreImpl(
const TimedSemaphoreImpl&);
129 TimedSemaphoreImpl& operator=(
const TimedSemaphoreImpl&);
135 enum { e_TIMED_OUT = -1 };
160 TimedSemaphoreImpl(
int count,
165 ~TimedSemaphoreImpl();
176 void post(
int number);
212TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
214: d_clockType(clockType)
216 int result = ::sem_init(&d_sem, 0, 0); (void)result;
221TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
223: d_clockType(clockType)
225 int result = ::sem_init(&d_sem, 0, count); (void)result;
230TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
231 ~TimedSemaphoreImpl()
233 ::sem_destroy(&d_sem);
238void TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::post()
244int TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
247 return ::sem_trywait(&d_sem);
253TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::clockType()
const
Definition bsls_timeinterval.h:307
#define BSLS_ASSERT_OPT(X)
Definition bsls_assert.h:2045
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bslmt_barrier.h:344
Enum
Definition bsls_systemclocktype.h:119
@ e_REALTIME
Definition bsls_systemclocktype.h:122