Do not report deadlock on relocking a recursive mutex; lock count not implemented yet
[c11tester.git] / include / mutex.h
index f5894952282be7024867a8880793383f82b8e5f7..1f573bd1e51dd128e0b5b8982aa113f5f70a212c 100644 (file)
@@ -8,17 +8,20 @@
 
 #include "modeltypes.h"
 #include "mymemory.h"
+#include "mypthread.h"
 
 namespace cdsc {
 struct mutex_state {
        void *locked;   /* Thread holding the lock */
        thread_id_t alloc_tid;
        modelclock_t alloc_clock;
+       int type;
+       int lock_count;
 };
 
 class mutex {
 public:
-       mutex();
+       mutex(int type = PTHREAD_MUTEX_DEFAULT);
        ~mutex() {}
        void lock();
        bool try_lock();
@@ -31,7 +34,7 @@ private:
 
 class snapmutex : public mutex {
 public:
-       snapmutex() : mutex()
+       snapmutex(int type = 0) : mutex(type)
        { }
        SNAPSHOTALLOC
 };