use own reentrant mutex implementation

This commit is contained in:
john30
2017-08-27 14:58:23 +02:00
parent 20c38b3a2c
commit 125cbcd661
4 changed files with 57 additions and 9 deletions
+31
View File
@@ -142,6 +142,37 @@ class WaitThread : public Thread {
pthread_cond_t m_cond;
};
/**
* A simple mutex.
*/
class Mutex {
public:
/**
* Constructor.
*/
Mutex();
/**
* Destructor.
*/
virtual ~Mutex();
/**
* Lock this mutex.
*/
void lock();
/**
* Unlock this mutex.
*/
void unlock();
private:
/** the mutex for waiting. */
pthread_mutex_t m_mutex;
};
} // namespace ebusd
#endif // LIB_UTILS_THREAD_H_