# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Oct 28 11:58:44 EET 1998 [metaconfig 3.0 PL70]
+# Generated on Mon Nov 2 13:57:54 EET 1998 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by jhi@iki.fi)
cat >/tmp/c1$$ <<EOF
d_pipe=''
d_poll=''
d_portable=''
+d_pthread_create_joinable=''
+pthread_create_joinable=''
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
set poll d_poll
eval $inlibc
+: how to create joinable pthreads
+if test "X$usethreads" = "X$define"; then
+ echo " "
+ echo "Checking what constant to use for creating joinable pthreads..." >&4
+ $cat >try.c <<'EOCP'
+#include <pthread.h>
+int main() {
+ int detachstate = JOINABLE;
+}
+EOCP
+ set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
+ if eval $compile; then
+ echo "You seem to use PTHREAD_CREATE_JOINABLE." >&2
+ val="$undef"
+ set d_pthread_create_joinable
+ eval $setvar
+ val=0
+ set pthread_create_joinable
+ eval $setvar
+ else
+ set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
+ if eval $compile; then
+ echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&2
+ val="$define"
+ set d_pthread_create_joinable
+ eval $setvar
+ val=PTHREAD_CREATE_UNDETACHED
+ set pthread_create_joinable
+ eval $setvar
+ else
+ set try -DJOINABLE=__UNDETACHED
+ if eval $compile; then
+ echo "You seem to use __UNDETACHED." >&2
+ val="$define"
+ set d_pthread_create_joinable
+ eval $setvar
+ val=__UNDETACHED
+ set pthread_create_joinable
+ eval $setvar
+ else
+ echo "Egads, nothing obvious found. Guessing that you use 0." >&2
+ val="$define"
+ set d_pthread_create_joinable
+ eval $setvar
+ val=0
+ set pthread_create_joinable
+ eval $setvar
+ fi
+ fi
+ fi
+ $rm -f try try.*
+else
+ d_pthread_create_joinable="$undef"
+ pthread_create_joinable=0
+fi
+
: see whether the various POSIXish _yields exist
$cat >try.c <<EOP
eval $inhdr
: see if mach cthreads are available
-set mach/cthreads.h i_machcthr
-eval $inhdr
+if test "X$usethreads" = "X$define"; then
+ set mach/cthreads.h i_machcthr
+ eval $inhdr
+else
+ i_machcthr="$undef"
+fi
+
+
: see if this is a math.h system
set math.h i_math
d_pipe='$d_pipe'
d_poll='$d_poll'
d_portable='$d_portable'
+d_pthread_create_joinable='$d_pthread_create_joinable'
d_pthread_yield='$d_pthread_yield'
d_pwage='$d_pwage'
d_pwchange='$d_pwchange'
privlib='$privlib'
privlibexp='$privlibexp'
prototype='$prototype'
+pthread_create_joinable='$pthread_create_joinable'
ptrsize='$ptrsize'
randbits='$randbits'
randfunc='$randfunc'
*/
#define ARCHNAME "$archname" /**/
+/* PTHREAD_CREATE_JOINABLE:
+ * This symbol, if defined, indicates how to create pthread
+ * in joinable (aka undetached) state. Not defined here if
+ * pthread.h already has defined PTHREAD_CREATE_JOINABLE.
+ * If defined, possible values are PTHREAD_CREATE_UNDETACHED
+ * and __UNDETACHED.
+ */
+#$d_pthread_create_joinable PTHREAD_CREATE_JOINABLE $pthread_create_joinable /**/
+
/* HAS_PTHREAD_YIELD:
* This symbol, if defined, indicates that the pthread_yield
* routine is available to yield the execution of the current
# endif
#endif
-#if !defined(ATTR_JOINABLE) && defined(PTHREAD_CREATE_JOINABLE)
-# define ATTR_JOINABLE PTHREAD_CREATE_JOINABLE
-#endif
-#if !defined(ATTR_JOINABLE) && defined(PTHREAD_CREATE_UNDETACHED)
-# define ATTR_JOINABLE PTHREAD_CREATE_UNDETACHED
-#endif
-#if !defined(ATTR_JOINABLE) && defined(__UNDETACHED)
-# define ATTR_JOINABLE __UNDETACHED
-#endif
-
#ifndef MUTEX_INIT
#define MUTEX_INIT(m) \
STMT_START { \