From: Artur Bergman Date: Sat, 13 Oct 2001 09:36:49 +0000 (+0000) Subject: We do want to set the attribute to joinable even on modern posix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ad0b7d62495f09650a2930686419b1c7284de46;p=p5sagit%2Fp5-mst-13.2.git We do want to set the attribute to joinable even on modern posix platforms. p4raw-id: //depot/perl@12423 --- diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 8db1b88..c0f3d45 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -156,7 +156,6 @@ SV* Perl_thread_create(char* class, SV* init_function, SV* params) { #else -#ifdef OLD_PTHREADS_API { static pthread_attr_t attr; static int attr_inited = 0; @@ -169,12 +168,12 @@ SV* Perl_thread_create(char* class, SV* init_function, SV* params) { # ifdef PTHREAD_ATTR_SETDETACHSTATE PTHREAD_ATTR_SETDETACHSTATE(&attr, attr_joinable); # endif - +#ifdef OLD_PTHREADS_API pthread_create( &thread->thr, attr, Perl_thread_run, (void *)thread); - } #else - pthread_create( &thread->thr, (pthread_attr_t*)NULL, Perl_thread_run, (void *)thread); + pthread_create( &thread->thr, &attr, Perl_thread_run, (void *)thread); #endif + } #endif MUTEX_UNLOCK(&create_mutex);