#include <thread.h>
#define PERL_THREAD_SETSPECIFIC(k,v) pthread_setspecific(k,v)
+#ifdef OLD_PTHREADS_API
+#define PERL_THREAD_DETACH(t) pthread_detach(&(t))
+#define PERL_THREAD_GETSPECIFIC(k,v) pthread_getspecific(k,&v)
#define PERL_THREAD_ALLOC_SPECIFIC(k) STMT_START {\
- if(pthread_key_create(&(k),0)) {\
+ if(pthread_keycreate(&(k),0)) {\
PerlIO_printf(PerlIO_stderr(), "panic threads.h: pthread_key_create");\
exit(1);\
}\
} STMT_END
-#ifdef OLD_PTHREADS_API
-#define PERL_THREAD_DETACH(t) pthread_detach(&(t))
-#define PERL_THREAD_GETSPECIFIC(k,v) pthread_getspecific(k,&v)
#else
#define PERL_THREAD_DETACH(t) pthread_detach((t))
#define PERL_THREAD_GETSPECIFIC(k,v) v = pthread_getspecific(k)
+#define PERL_THREAD_ALLOC_SPECIFIC(k) STMT_START {\
+ if(pthread_key_create(&(k),0)) {\
+ PerlIO_printf(PerlIO_stderr(), "panic threads.h: pthread_key_create");\
+ exit(1);\
+ }\
+} STMT_END
#endif
#endif