X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=blobdiff_plain;f=include%2Fthreads.h;h=f38be0ab96ecf973873ffc1c03576da0dad47c28;hp=d1ff1929aba37840d9cab9f5b5bf087639057550;hb=26010e1410faa0dcefc8d384872bc0210cc0be92;hpb=26d1dd1430da05b8da4b1250b299a620ecd52102 diff --git a/include/threads.h b/include/threads.h index d1ff192..f38be0a 100644 --- a/include/threads.h +++ b/include/threads.h @@ -5,13 +5,23 @@ #ifndef __THREADS_H__ #define __THREADS_H__ +/* Forward declaration */ +#ifdef __cplusplus +typedef class Thread *__thread_identifier; +#else +/* For C, we just need an opaque pointer */ +typedef void *__thread_identifier; +#endif + #ifdef __cplusplus extern "C" { #endif typedef void (*thrd_start_t)(void *); - typedef int thrd_t; + typedef struct { + __thread_identifier priv; + } thrd_t; int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg); int thrd_join(thrd_t);