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)
100class BslLockImpl_pthread {
103 pthread_mutex_t d_lock;
107 BslLockImpl_pthread(
const BslLockImpl_pthread&);
108 BslLockImpl_pthread& operator=(
const BslLockImpl_pthread&);
114 BslLockImpl_pthread();
119 ~BslLockImpl_pthread();
151BslLockImpl_pthread::BslLockImpl_pthread()
153 const int status = pthread_mutex_init(&d_lock, 0);
155 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
159BslLockImpl_pthread::~BslLockImpl_pthread()
161 const int status = pthread_mutex_destroy(&d_lock);
163 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
168void BslLockImpl_pthread::lock()
170 const int status = pthread_mutex_lock(&d_lock);
172 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
176void BslLockImpl_pthread::unlock()
178 const int status = pthread_mutex_unlock(&d_lock);
180 BSLS_BSLLOCKIMPL_PTHREAD_ASSERT_SAFE(0 == status);
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlt_iso8601util.h:707