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>
97class MutexImpl<Platform::PosixThreads> {
100 pthread_mutex_t d_lock;
103 MutexImpl(
const MutexImpl&);
104 MutexImpl& operator=(
const MutexImpl&);
111 typedef pthread_mutex_t NativeType;
136 NativeType& nativeMutex();
159MutexImpl<bslmt::Platform::PosixThreads>::MutexImpl()
161 const int status = pthread_mutex_init(&d_lock, 0);
169void MutexImpl<bslmt::Platform::PosixThreads>::lock()
172 *
reinterpret_cast<const unsigned *
>(&d_lock));
174 const int status = pthread_mutex_lock(&d_lock);
180int MutexImpl<bslmt::Platform::PosixThreads>::tryLock()
183 *
reinterpret_cast<const unsigned *
>(&d_lock));
185 return pthread_mutex_trylock(&d_lock);
189void MutexImpl<bslmt::Platform::PosixThreads>::unlock()
192 *
reinterpret_cast<const unsigned *
>(&d_lock));
194 const int status = pthread_mutex_unlock(&d_lock);
200MutexImpl<bslmt::Platform::PosixThreads>::NativeType&
201MutexImpl<bslmt::Platform::PosixThreads>::nativeMutex()
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_ASSERT_INVOKE_NORETURN(X)
Definition bsls_assert.h:1895
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bslmt_barrier.h:344