move libthreads.h -> include/threads.h
authorBrian Norris <banorris@uci.edu>
Tue, 9 Oct 2012 19:09:02 +0000 (12:09 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 9 Oct 2012 21:15:16 +0000 (14:15 -0700)
Helps user programs to be able to just use C11 <threads.h>

12 files changed:
include/threads.h [new file with mode: 0644]
libthreads.cc
libthreads.h [deleted file]
main.cc
test/double-relseq.c
test/linuxrwlocks.c
test/pending-release.c
test/releaseseq.c
test/rmwprog.c
test/userprog.c
threads-model.h
threads.cc

diff --git a/include/threads.h b/include/threads.h
new file mode 100644 (file)
index 0000000..641b0cf
--- /dev/null
@@ -0,0 +1,27 @@
+/** @file threads.h
+ *  @brief C11 Thread Library Functionality
+ */
+
+#ifndef __THREADS_H__
+#define __THREADS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+       typedef void (*thrd_start_t)(void *);
+
+       typedef int thrd_t;
+
+       int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg);
+       int thrd_join(thrd_t);
+       int thrd_yield(void);
+       thrd_t thrd_current(void);
+
+       int user_main(int, char**);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __THREADS_H__ */
index 9e34141bc1de608abdb89393a3fe63570ff25f7d..2b2bf85ac374b2a57ab85b2ddfb82f184c6372ea 100644 (file)
@@ -1,4 +1,4 @@
-#include "libthreads.h"
+#include <threads.h>
 #include "common.h"
 #include "threads-model.h"
 
diff --git a/libthreads.h b/libthreads.h
deleted file mode 100644 (file)
index 8033a12..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/** @file libthreads.h
- *  @brief Basic Thread Library Functionality.
- */
-
-#ifndef __LIBTHREADS_H__
-#define __LIBTHREADS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-       typedef void (*thrd_start_t)(void *);
-
-       typedef int thrd_t;
-
-       int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg);
-       int thrd_join(thrd_t);
-       int thrd_yield(void);
-       thrd_t thrd_current(void);
-
-       int user_main(int, char**);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __LIBTHREADS_H__ */
diff --git a/main.cc b/main.cc
index bff111f09dc28a99eff0ff2b70b4526141f39737..6624f0685e42c551949273feb3af9d2e0a67597a 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -4,7 +4,7 @@
 
 #include <unistd.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "common.h"
 #include "threads-model.h"
 
index 369265a7d6246eb3a250ac1297821d53189ecf7f..53147b72035e914bb095daa74eee3a968557de0b 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <stdio.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "librace.h"
 #include "stdatomic.h"
 
index a14ed02028796a422cd4f6ae7b20d8323796e093..ac2fe521a36f77bcc7eb523d2c0254d1396f6b6a 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "librace.h"
 #include "stdatomic.h"
 
index 739c45e0f675931507e35e9b656a767fdf04fb5d..d74dcca642ba74e4ec44564aeb3118de0c396483 100644 (file)
@@ -7,7 +7,7 @@
 
 #include <stdio.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "librace.h"
 #include "stdatomic.h"
 
index 27f2fb1cb8e5f5a357ce3da6a981f5e223538281..cbb8ef5630111d651788729c75897a845983167c 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "librace.h"
 #include "stdatomic.h"
 
index a74ae426ca95df7e90f63424d4aaaa3a327e7292..5911e5a3cdd870820a1af60509bbbfbc1dea0868 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "librace.h"
 #include "stdatomic.h"
 
index b45e8f9dcebe338cfa4374a75c8aaaa45e54a92b..6ad49092d7e1073ebe40bd8a868049847adc78f8 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "librace.h"
 #include "stdatomic.h"
 
index 28d237d47c9125f2c68ebae2a7e9e85035d444d7..8b165d541394a8fcc23089e354b9c1b8c48da4f4 100644 (file)
@@ -10,7 +10,7 @@
 #include <vector>
 
 #include "mymemory.h"
-#include "libthreads.h"
+#include <threads.h>
 #include "modeltypes.h"
 
 /** @brief Represents the state of a user Thread */
index 2ff058f45ebe727e952b2769a9f2336dc461106b..dc2db2d9bfefcab57458035f3f4bc815b75b5fc5 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <string.h>
 
-#include "libthreads.h"
+#include <threads.h>
 #include "common.h"
 #include "threads-model.h"