This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pthread_keycreate not pthread_key_create under the here be dragons API
[perl5.git] / ext / threads / threads.h
index 01baaa4..72a4872 100755 (executable)
@@ -23,18 +23,24 @@ STMT_START {\
 #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