8#ifndef INCLUDED_BSLS_BSLLOCKIMPL_PTHREAD
9#define INCLUDED_BSLS_BSLLOCKIMPL_PTHREAD
66#include <bsls_buildtarget.h>
69#ifdef BSLS_PLATFORM_OS_UNIX
73#ifdef BDE_BUILD_TARGET_SAFE
80#define BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(x) assert((x))
82#define BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(x)
99class BslLockImpl_pthread {
102 pthread_mutex_t d_lock;
106 BslLockImpl_pthread(
const BslLockImpl_pthread&);
107 BslLockImpl_pthread& operator=(
const BslLockImpl_pthread&);
113 BslLockImpl_pthread();
117 ~BslLockImpl_pthread();
146BslLockImpl_pthread::BslLockImpl_pthread()
148 const int status = pthread_mutex_init(&d_lock, 0);
150 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
154BslLockImpl_pthread::~BslLockImpl_pthread()
156 const int status = pthread_mutex_destroy(&d_lock);
158 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
163void BslLockImpl_pthread::lock()
165 const int status = pthread_mutex_lock(&d_lock);
167 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
171void BslLockImpl_pthread::unlock()
173 const int status = pthread_mutex_unlock(&d_lock);
175 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691