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;
117class TimedSemaphoreImpl<Platform::PosixAdvTimedSemaphore> {
126 TimedSemaphoreImpl(
const TimedSemaphoreImpl&);
127 TimedSemaphoreImpl& operator=(
const TimedSemaphoreImpl&);
133 enum { e_TIMED_OUT = -1 };
158 TimedSemaphoreImpl(
int count,
163 ~TimedSemaphoreImpl();
173 void post(
int number);
209TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
211: d_clockType(clockType)
213 int result = ::sem_init(&d_sem, 0, 0); (void)result;
218TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
220: d_clockType(clockType)
222 int result = ::sem_init(&d_sem, 0, count); (void)result;
227TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
228 ~TimedSemaphoreImpl()
230 ::sem_destroy(&d_sem);
235void TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::post()
241int TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::
244 return ::sem_trywait(&d_sem);
250TimedSemaphoreImpl<bslmt::Platform::PosixAdvTimedSemaphore>::clockType()
const
Definition bsls_timeinterval.h:301
#define BSLS_ASSERT_OPT(X)
Definition bsls_assert.h:1856
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bslmt_barrier.h:344
Enum
Definition bsls_systemclocktype.h:117
@ e_REALTIME
Definition bsls_systemclocktype.h:120