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;
101 SemaphoreImpl(
const SemaphoreImpl&);
102 SemaphoreImpl& operator=(
const SemaphoreImpl&);
110 SemaphoreImpl(
int count);
123 void post(
int number);
136 int getValue()
const;
149SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::~SemaphoreImpl()
151 int result = ::sem_close(d_sem_p);
159void SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::post()
161 int result = ::sem_post(d_sem_p);
168int SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::tryWait()
170 return ::sem_trywait(d_sem_p);
176int SemaphoreImpl<bslmt::Platform::DarwinSemaphore>::getValue()
const
180 "`sem_getvalue` is optional in POSIX and not implemented on Darwin");
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_ASSERT_UNREACHABLE(X)
Definition bsls_assert.h:1996
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bslmt_barrier.h:344