X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=blobdiff_plain;f=include%2Fthreads.h;h=f38be0ab96ecf973873ffc1c03576da0dad47c28;hp=66df5b1191cfa1d050d020c7bd3a01d3e4bd9fc3;hb=26010e1410faa0dcefc8d384872bc0210cc0be92;hpb=8e70d2b46a3e66a95d13f091f92450a0c05fe54f diff --git a/include/threads.h b/include/threads.h index 66df5b1..f38be0a 100644 --- a/include/threads.h +++ b/include/threads.h @@ -6,7 +6,12 @@ #define __THREADS_H__ /* Forward declaration */ -struct Thread; /* actually, class; but this is safe */ +#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" { @@ -15,7 +20,7 @@ extern "C" { typedef void (*thrd_start_t)(void *); typedef struct { - struct Thread *priv; + __thread_identifier priv; } thrd_t; int thrd_create(thrd_t *t, thrd_start_t start_routine, void *arg);