37 pthread_mutexattr_t mutex_attr;
38 pthread_mutexattr_init(&mutex_attr);
39 pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE);
40 pthread_mutex_init(
m_mutex, &mutex_attr);
41 pthread_mutexattr_destroy(&mutex_attr);
56 return pthread_mutex_lock(
m_mutex) == 0;
61 #ifdef _SYSTEM_DARWIN_ 62 int ret = pthread_mutex_trylock(
m_mutex);
67 ret = pthread_mutex_trylock(
m_mutex);
71 struct timespec timeout_spec = timeout.timespec();
72 int ret = pthread_mutex_timedlock(
m_mutex, &timeout_spec);
84 int ret = pthread_mutex_trylock(
m_mutex);
TimeStamp getAbsoluteTimeout(const TimeSpan &timeout_relative)
pthread_mutex_t * m_mutex
int usleep(unsigned long useconds)
Contains icl_core::thread::tMutex.
const TimeSpan timeout(1, 0)
virtual ~MutexImplPosix()
Contains global functions for time manipulation, encapsulated into the icl_core::os namespace...
Contains icl_core::thread::MutexImplPosix.