27 pthread_mutex_t m_mutex;
29 static pthread_mutexattr_t& getRecursiveAttr();
35 inline CRecursiveMutex() { pthread_mutex_init(&m_mutex, &getRecursiveAttr()); }
39 inline void lock() { pthread_mutex_lock(&m_mutex); }
41 inline void unlock() { pthread_mutex_unlock(&m_mutex); }
43 inline bool try_lock() {
return (pthread_mutex_trylock(&m_mutex) == 0); }
45 inline std::recursive_mutex::native_handle_type native_handle() {
return &m_mutex; }
This class exists purely for the ability to set mutex attribute PTHREAD_PRIO_INHERIT. Currently there is no way to set this using std::recursive_mutex.
Definition: RecursiveMutex.h:24
Definition: RecursiveMutex.cpp:11