8#ifndef INCLUDED_BSLMT_SEMAPHOREIMPL_DARWIN
9#define INCLUDED_BSLMT_SEMAPHOREIMPL_DARWIN
69#include <bslscm_version.h>
76#ifdef BSLS_PLATFORM_OS_DARWIN
82template <
class SEMAPHORE_POLICY>
93class SemaphoreImpl<Platform::DarwinSemaphore> {
97 static const char *s_semaphorePrefix;
100 SemaphoreImpl(
const SemaphoreImpl&);
101 SemaphoreImpl& operator=(
const SemaphoreImpl&);
109 SemaphoreImpl(
int count);
121 void post(
int number);
134 int getValue()
const;
147SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::~SemaphoreImpl()
149 int result = ::sem_close(d_sem_p);
157void SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::post()
159 int result = ::sem_post(d_sem_p);
166int SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::tryWait()
168 return ::sem_trywait(d_sem_p);
174int SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::getValue()
const
178 "sem_getvalue is optional in POSIX and not implemented on Darwin");
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bslmt_barrier.h:344