The important exported interfaces should be in the include/ dir. Also,
C++11 programs should use this header as:
#include <mutex>
--- /dev/null
+/**
+ * @file mutex
+ * @brief C++11 mutex interface header
+ */
+
+#ifndef __CXX_MUTEX__
+#define __CXX_MUTEX__
+
+#include "modeltypes.h"
+
+namespace std {
+ struct mutex_state {
+ bool islocked;
+ thread_id_t alloc_tid;
+ modelclock_t alloc_clock;
+ };
+
+ class mutex {
+ public:
+ mutex();
+ ~mutex();
+ void lock();
+ bool try_lock();
+ void unlock();
+ struct mutex_state * get_state() {return &state;}
+
+ private:
+ struct mutex_state state;
+ };
+}
+#endif /* __CXX_MUTEX__ */
#include <stdio.h>
#include <algorithm>
+#include <mutex>
#include "model.h"
#include "action.h"
#include "cyclegraph.h"
#include "promise.h"
#include "datarace.h"
-#include "mutex.h"
#include "threads-model.h"
#define INITIAL_THREAD_ID 0
-#include "mutex.h"
+#include <mutex>
+
#include "model.h"
#include "threads-model.h"
#include "clockvector.h"
+++ /dev/null
-#ifndef MUTEX_H
-#define MUTEX_H
-
-#include "modeltypes.h"
-
-namespace std {
- struct mutex_state {
- bool islocked;
- thread_id_t alloc_tid;
- modelclock_t alloc_clock;
- };
-
- class mutex {
- public:
- mutex();
- ~mutex();
- void lock();
- bool try_lock();
- void unlock();
- struct mutex_state * get_state() {return &state;}
-
- private:
- struct mutex_state state;
- };
-}
-#endif