From: Jarkko Hietaniemi <jhi@iki.fi> Date: Sat, 24 May 2003 05:57:49 +0000 (+0000) Subject: Add a real scan for pthread_attr_setscope(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58d975c3f477b5042b8ebb54dfefbe22116c9794;p=p5sagit%2Fp5-mst-13.2.git Add a real scan for pthread_attr_setscope(). p4raw-id: //depot/perl@19604 --- diff --git a/Configure b/Configure index 201dedb..8e2a765 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed May 7 23:33:48 EET DST 2003 [metaconfig 3.0 PL70] +# Generated on Sat May 24 10:07:39 EET DST 2003 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <<EOF @@ -580,6 +580,7 @@ procselfexe='' d_old_pthread_create_joinable='' old_pthread_create_joinable='' d_pthread_atfork='' +d_pthread_attr_setscope='' d_pthread_yield='' d_sched_yield='' sched_yield='' @@ -14707,6 +14708,10 @@ esac set d_pthread_atfork eval $setvar +: see if pthread_attr_setscope exists +set pthread_attr_setscope d_pthread_attr_setscope +eval $inlibc + : see whether the various POSIXish _yields exist $cat >try.c <<EOP @@ -20724,6 +20729,7 @@ d_poll='$d_poll' d_portable='$d_portable' d_procselfexe='$d_procselfexe' d_pthread_atfork='$d_pthread_atfork' +d_pthread_attr_setscope='$d_pthread_attr_setscope' d_pthread_yield='$d_pthread_yield' d_pwage='$d_pwage' d_pwchange='$d_pwchange' diff --git a/config_h.SH b/config_h.SH index 3820677..73cc186 100644 --- a/config_h.SH +++ b/config_h.SH @@ -2694,6 +2694,13 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #define PROCSELFEXE_PATH $procselfexe /**/ #endif +/* HAS_PTHREAD_ATTR_SETSCOPE: + * This symbol, if defined, indicates that the pthread_attr_setscope + * system call is available to set the contention scope attribute of + * a thread attribute object. + */ +#$d_pthread_attr_setscope HAS_PTHREAD_ATTR_SETSCOPE /**/ + /* HAS_READV: * This symbol, if defined, indicates that the readv routine is * available to do gather reads. You will also need <sys/uio.h> diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index a03ec3c..6ef046f 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -506,7 +506,7 @@ Perl_ithread_create(pTHX_ SV *obj, char* classname, SV* init_function, SV* param #ifdef OLD_PTHREADS_API pthread_create( &thread->thr, attr, Perl_ithread_run, (void *)thread); #else -# ifdef PTHREAD_SCOPE_SYSTEM +# if defined(HAS_PTHREAD_ATTR_SETSCOPE) && defined(PTHREAD_SCOPE_SYSTEM) pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); # endif pthread_create( &thread->thr, &attr, Perl_ithread_run, (void *)thread);