Refactored the ReentrantMutex support so that it utilises the underling thread implementation for recusive mutex support.

This commit is contained in:
Robert Osfield
2010-02-18 20:14:41 +00:00
parent ab66740fb0
commit 787daeeb93
5 changed files with 33 additions and 100 deletions

View File

@@ -34,16 +34,26 @@ class OPENTHREAD_EXPORT_DIRECTIVE Mutex {
public:
enum MutexType
{
MUTEX_NORMAL,
MUTEX_RECURSIVE
};
/**
* Constructor
*/
Mutex();
Mutex(MutexType type=MUTEX_NORMAL);
/**
* Destructor
*/
virtual ~Mutex();
MutexType getMutexType() const { return _mutexType; }
/**
* Lock the mutex
*
@@ -81,6 +91,7 @@ private:
* Implementation-specific private data.
*/
void *_prvData;
MutexType _mutexType;
};