ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change
on this file since c4e3419c was
72b1800,
checked in by Thierry Delisle <tdelisle@…>, 4 years ago
|
Some previous in progress work.
Commited only so it stops showing in my git status.
|
-
Property mode set to
100644
|
File size:
872 bytes
|
Line | |
---|
1 | #if !defined(WITH_PTHREADS) && !defined(WITH_LIBFIBRE) && !defined(WITH_CFORALL) |
---|
2 | #error must define WITH_PTHREADS, WITH_LIBFIBRE or WITH_CFORALL |
---|
3 | #endif |
---|
4 | |
---|
5 | #ifdef WITH_PTHREADS |
---|
6 | #include "pthread.hpp" |
---|
7 | #endif |
---|
8 | #ifdef WITH_LIBFIBRE |
---|
9 | #include "fibre.hpp" |
---|
10 | #endif |
---|
11 | #ifdef WITH_CFORALL |
---|
12 | #include "cforall.hpp" |
---|
13 | #endif |
---|
14 | |
---|
15 | namespace thrdlib { |
---|
16 | //-------------------- |
---|
17 | // Basic thread support |
---|
18 | void * create( void (*main)( void * ) ) { return (thread_t)thrdlib_create( (void (*)( thread_t )) main ); } |
---|
19 | void join ( void * handle ) { thrdlib_join ((thread_t)handle); } |
---|
20 | void park ( void * handle ) { thrdlib_park ((thread_t)handle); } |
---|
21 | void unpark( void * handle ) { thrdlib_unpark((thread_t)handle); } |
---|
22 | void yield( void ) { thrdlib_yield(); } |
---|
23 | |
---|
24 | //-------------------- |
---|
25 | // Basic kernel features |
---|
26 | void init( int procs ) { thrdlib_init(procs); } |
---|
27 | void clean( void ) { thrdlib_clean(); } |
---|
28 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.