8#ifndef INCLUDED_BSLMT_MUTEXIMPL_PTHREAD
9#define INCLUDED_BSLMT_MUTEXIMPL_PTHREAD
68#include <bslscm_version.h>
72#ifdef BSLMT_PLATFORM_POSIX_THREADS
78#include <bsl_cstring.h>
85template <
class THREAD_POLICY>
98class MutexImpl<Platform::PosixThreads> {
101 pthread_mutex_t d_lock;
105 MutexImpl(
const MutexImpl&);
106 MutexImpl& operator=(
const MutexImpl&);
113 typedef pthread_mutex_t NativeType;
140 NativeType& nativeMutex();
163MutexImpl<bslmt::Platform::PosixThreads>::MutexImpl()
165 const int status = pthread_mutex_init(&d_lock, 0);
173void MutexImpl<bslmt::Platform::PosixThreads>::lock()
176 *
reinterpret_cast<const unsigned *
>(&d_lock));
178 const int status = pthread_mutex_lock(&d_lock);
184int MutexImpl<bslmt::Platform::PosixThreads>::tryLock()
187 *
reinterpret_cast<const unsigned *
>(&d_lock));
189 return pthread_mutex_trylock(&d_lock);
193void MutexImpl<bslmt::Platform::PosixThreads>::unlock()
196 *
reinterpret_cast<const unsigned *
>(&d_lock));
198 const int status = pthread_mutex_unlock(&d_lock);
204MutexImpl<bslmt::Platform::PosixThreads>::NativeType&
205MutexImpl<bslmt::Platform::PosixThreads>::nativeMutex()
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_ASSERT_INVOKE_NORETURN(X)
Definition bsls_assert.h:2101
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bslmt_barrier.h:344