8#ifndef INCLUDED_BSLMT_SEMAPHOREIMPL_PTHREAD
9#define INCLUDED_BSLMT_SEMAPHOREIMPL_PTHREAD
68#include <bslscm_version.h>
72#if defined(BSLMT_PLATFORM_POSIX_SEMAPHORE)
83template <
class SEMAPHORE_POLICY>
94class SemaphoreImpl<Platform::PosixSemaphore> {
101 SemaphoreImpl(
const SemaphoreImpl&);
102 SemaphoreImpl& operator=(
const SemaphoreImpl&);
111 SemaphoreImpl(
int count);
123 void post(
int number);
136 int getValue()
const;
149SemaphoreImpl<bslmt::Platform::PosixSemaphore>::~SemaphoreImpl()
151 int result = ::sem_destroy(&d_sem);
159void SemaphoreImpl<bslmt::Platform::PosixSemaphore>::post()
161 int result = ::sem_post(&d_sem);
168int SemaphoreImpl<bslmt::Platform::PosixSemaphore>::tryWait()
170 return ::sem_trywait(&d_sem);
175int SemaphoreImpl<bslmt::Platform::PosixSemaphore>::getValue()
const
178 int result = ::sem_getvalue(
const_cast<sem_t *
>(&d_sem), &value);
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bslmt_barrier.h:344