summaryrefslogtreecommitdiff
path: root/ext/Thread
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-10-15 03:09:58 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-10-15 03:09:58 +0000
commit1cfa4ec74d4933da0d98282eed6171cc7ac307b6 (patch)
tree16e2d6216053294709570ec219063df3229545f4 /ext/Thread
parent1e2878e610af032604518a9feca8663968d7369a (diff)
downloadperl-1cfa4ec74d4933da0d98282eed6171cc7ac307b6.tar.gz
check in all confperl changes as of change#1964 into cfgperl
p4raw-link: @1964 on //depot/confperl: 2d85315bb227e0962a693eaaadc3f40ca2fbf49b p4raw-id: //depot/cfgperl@1971
Diffstat (limited to 'ext/Thread')
-rw-r--r--ext/Thread/Thread.xs21
1 files changed, 17 insertions, 4 deletions
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs
index a4bff69a9b..84f9f57fc5 100644
--- a/ext/Thread/Thread.xs
+++ b/ext/Thread/Thread.xs
@@ -230,7 +230,10 @@ newthread (SV *startsv, AV *initargs, char *classname)
static int attr_inited = 0;
sigset_t fullmask, oldmask;
#endif
-
+#ifdef PTHREAD_SETDETACHSTATE_ARG2_POINTER
+ static int attr_joinable = ATTR_JOINABLE;
+#endif
+
savethread = thr;
thr = new_struct_thread(thr);
SPAGAIN;
@@ -264,14 +267,24 @@ newthread (SV *startsv, AV *initargs, char *classname)
#ifdef OLD_PTHREADS_API
#ifdef VMS
/* This is available with the old pthreads API, but only with */
-/* DecThreads (VMS and Digital Unix) */
+/* DecThreads (VMS and Digital Unix (which has and uses the new one)) */
if (err == 0)
err = pthread_attr_setdetach_np(&attr, ATTR_JOINABLE);
#endif
-#else
+#else /* !defined(VMS) */
+#ifdef ATTR_JOINABLE
if (err == 0)
err = pthread_attr_setdetachstate(&attr, ATTR_JOINABLE);
-#endif
+#else /* !defined(ATTR_JOINABLE) */
+#ifdef __UNDETACHED
+ if (err == 0)
+ err = pthread_attr_setdetachstate(&attr, &__undetached);
+#else /* !defined(__UNDETACHED) */
+ croak("panic: can't pthread_attr_setdetachstate");
+#endif /* __UNDETACHED */
+#endif /* ATTR_JOINABLE */
+#endif /* VMS */
+#endif /* OLD_PTHREADS_API */
}
if (err == 0)
#ifdef OLD_PTHREADS_API