X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Fthreads.h;h=2e1f6faeadc908c71146722c24c377f1a3dee845;hb=99677c35ae2bfd651274191143e140d730fc9925;hp=c9e3b07f24b656a1730f22f7349f3feb656791eb;hpb=ab6ee64b38cee9cd2ce9872714c77c19da9fb031;p=pdclib.old diff --git a/includes/threads.h b/includes/threads.h index c9e3b07..2e1f6fa 100644 --- a/includes/threads.h +++ b/includes/threads.h @@ -25,10 +25,10 @@ enum { }; #define ONCE_FLAG_INIT _PDCLIB_ONCE_FLAG_INIT -#if defined(_PDCLIB_ONCE_FLAG_DONE) +#if defined(_PDCLIB_ONCE_FLAG_IS_DONE) static inline void call_once(once_flag *flag, void (*func)(void)) { - if(*flag != _PDCLIB_ONCE_FLAG_DONE) { + if(!_PDCLIB_ONCE_FLAG_IS_DONE(flag)) { _PDCLIB_call_once(flag, func); } } @@ -61,7 +61,7 @@ int cnd_wait(cnd_t *cond, mtx_t *mtx) _PDCLIB_nothrow; #if defined(_PDCLIB_THRD_T) #define _PDCLIB_THRD_HAVE_MISC typedef _PDCLIB_THRD_T thrd_t; -typedef int (*)(void*) thrd_start_t; +typedef int (*thrd_start_t)(void*); int thrd_create(thrd_t *thr, thrd_start_t func, void *arg) _PDCLIB_nothrow; thrd_t thrd_current(void) _PDCLIB_nothrow;