Add a real scan for pthread_attr_setscope().
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 24 May 2003 05:57:49 +0000 (05:57 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 24 May 2003 05:57:49 +0000 (05:57 +0000)
p4raw-id: //depot/perl@19604

Configure
config_h.SH
ext/threads/threads.xs

index 201dedb..8e2a765 100755 (executable)
--- 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'
index 3820677..73cc186 100644 (file)
@@ -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>
index a03ec3c..6ef046f 100755 (executable)
@@ -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);