X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Fthreads.h;h=77e39d494f77a579830cd2151ab68a55bf9a31eb;hb=ad695562522feac5197c19716dd91922f229cf32;hp=4549883cd5e2463022e21734ef94e5029f6e566a;hpb=d265e525e9f73e8f40fed2686d778339de55f20e;p=pdclib.old diff --git a/includes/threads.h b/includes/threads.h index 4549883..77e39d4 100644 --- a/includes/threads.h +++ b/includes/threads.h @@ -1,5 +1,6 @@ #ifndef _PDCLIB_THREADS_H #define _PDCLIB_THREADS_H +#include <_PDCLIB_int.h> #include <_PDCLIB_threadconfig.h> #include _PDCLIB_BEGIN_EXTERN_C @@ -28,12 +29,12 @@ enum { #if defined(_PDCLIB_ONCE_FLAG_IS_DONE) static inline void call_once(once_flag *flag, void (*func)(void)) { - if(_PDCLIB_ONCE_FLAG_IS_DONE(flag)) { + if(!_PDCLIB_ONCE_FLAG_IS_DONE(flag)) { _PDCLIB_call_once(flag, func); } } #else -void call_once(once_flag *flag, void (*func)(void)) +void call_once(once_flag *flag, void (*func)(void)); #endif #if defined(_PDCLIB_MTX_T) @@ -61,7 +62,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;