From: Brian Norris Date: Tue, 9 Oct 2012 19:09:02 +0000 (-0700) Subject: move libthreads.h -> include/threads.h X-Git-Tag: pldi2013~67 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=616746ec12aae78b0d0262c009568109686cb000 move libthreads.h -> include/threads.h Helps user programs to be able to just use C11 --- diff --git a/include/threads.h b/include/threads.h new file mode 100644 index 0000000..641b0cf --- /dev/null +++ b/include/threads.h @@ -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__ */ diff --git a/libthreads.cc b/libthreads.cc index 9e34141..2b2bf85 100644 --- a/libthreads.cc +++ b/libthreads.cc @@ -1,4 +1,4 @@ -#include "libthreads.h" +#include #include "common.h" #include "threads-model.h" diff --git a/libthreads.h b/libthreads.h deleted file mode 100644 index 8033a12..0000000 --- a/libthreads.h +++ /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 bff111f..6624f06 100644 --- a/main.cc +++ b/main.cc @@ -4,7 +4,7 @@ #include -#include "libthreads.h" +#include #include "common.h" #include "threads-model.h" diff --git a/test/double-relseq.c b/test/double-relseq.c index 369265a..53147b7 100644 --- a/test/double-relseq.c +++ b/test/double-relseq.c @@ -11,7 +11,7 @@ #include -#include "libthreads.h" +#include #include "librace.h" #include "stdatomic.h" diff --git a/test/linuxrwlocks.c b/test/linuxrwlocks.c index a14ed02..ac2fe52 100644 --- a/test/linuxrwlocks.c +++ b/test/linuxrwlocks.c @@ -1,6 +1,6 @@ #include -#include "libthreads.h" +#include #include "librace.h" #include "stdatomic.h" diff --git a/test/pending-release.c b/test/pending-release.c index 739c45e..d74dcca 100644 --- a/test/pending-release.c +++ b/test/pending-release.c @@ -7,7 +7,7 @@ #include -#include "libthreads.h" +#include #include "librace.h" #include "stdatomic.h" diff --git a/test/releaseseq.c b/test/releaseseq.c index 27f2fb1..cbb8ef5 100644 --- a/test/releaseseq.c +++ b/test/releaseseq.c @@ -6,7 +6,7 @@ #include -#include "libthreads.h" +#include #include "librace.h" #include "stdatomic.h" diff --git a/test/rmwprog.c b/test/rmwprog.c index a74ae42..5911e5a 100644 --- a/test/rmwprog.c +++ b/test/rmwprog.c @@ -1,6 +1,6 @@ #include -#include "libthreads.h" +#include #include "librace.h" #include "stdatomic.h" diff --git a/test/userprog.c b/test/userprog.c index b45e8f9..6ad4909 100644 --- a/test/userprog.c +++ b/test/userprog.c @@ -1,6 +1,6 @@ #include -#include "libthreads.h" +#include #include "librace.h" #include "stdatomic.h" diff --git a/threads-model.h b/threads-model.h index 28d237d..8b165d5 100644 --- a/threads-model.h +++ b/threads-model.h @@ -10,7 +10,7 @@ #include #include "mymemory.h" -#include "libthreads.h" +#include #include "modeltypes.h" /** @brief Represents the state of a user Thread */ diff --git a/threads.cc b/threads.cc index 2ff058f..dc2db2d 100644 --- a/threads.cc +++ b/threads.cc @@ -4,7 +4,7 @@ #include -#include "libthreads.h" +#include #include "common.h" #include "threads-model.h"