condition_variable: move header
authorBrian Norris <banorris@uci.edu>
Fri, 12 Oct 2012 17:14:44 +0000 (10:14 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 12 Oct 2012 17:14:44 +0000 (10:14 -0700)
Move from "conditionvariable.h" to "include/condition_variable". This
allows the normal C++11 #include syntax of:

  #include <condition_variable>

conditionvariable.cc
conditionvariable.h [deleted file]
include/condition_variable [new file with mode: 0644]
test/condvar.cc

index 5bd0beb..ce33e80 100644 (file)
@@ -1,6 +1,6 @@
 #include <mutex>
 #include "model.h"
-#include "conditionvariable.h"
+#include <condition_variable>
 
 
 namespace std {
diff --git a/conditionvariable.h b/conditionvariable.h
deleted file mode 100644 (file)
index d1db7ff..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef CONDITIONVARIABLE_H
-#define CONDITIONVARIABLE_H
-
-namespace std {
-       class mutex;
-
-       struct condition_variable_state {
-               int reserved;
-       };
-
-       class condition_variable {
-       public:
-               condition_variable();
-               ~condition_variable();
-               void notify_one();
-               void notify_all();
-               void wait(mutex& lock);
-               
-       private:
-               struct condition_variable_state state;
-       };
-}
-#endif
diff --git a/include/condition_variable b/include/condition_variable
new file mode 100644 (file)
index 0000000..2a7447b
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __CXX_CONDITION_VARIABLE__
+#define __CXX_CONDITION_VARIABLE__
+
+namespace std {
+       class mutex;
+
+       struct condition_variable_state {
+               int reserved;
+       };
+
+       class condition_variable {
+       public:
+               condition_variable();
+               ~condition_variable();
+               void notify_one();
+               void notify_all();
+               void wait(mutex& lock);
+               
+       private:
+               struct condition_variable_state state;
+       };
+}
+
+#endif /* __CXX_CONDITION_VARIABLE__ */
index 488f9be..ff8feb1 100644 (file)
@@ -4,7 +4,7 @@
 #include "librace.h"
 #include "stdatomic.h"
 #include <mutex>
-#include "conditionvariable.h"
+#include <condition_variable>
 
 std::mutex * m;
 std::condition_variable *v;