From: Artur Bergman Date: Fri, 12 Oct 2001 18:11:45 +0000 (+0000) Subject: pthread_keycreate not pthread_key_create under the here be dragons API X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74f0f59828f15458dfb57277ad8876f890f24446;p=p5sagit%2Fp5-mst-13.2.git pthread_keycreate not pthread_key_create under the here be dragons API p4raw-id: //depot/perl@12411 --- diff --git a/ext/threads/threads.h b/ext/threads/threads.h index 01baaa4..72a4872 100755 --- a/ext/threads/threads.h +++ b/ext/threads/threads.h @@ -23,18 +23,24 @@ STMT_START {\ #include #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