summaryrefslogtreecommitdiff
path: root/thread.h
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 /thread.h
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 'thread.h')
-rw-r--r--thread.h40
1 files changed, 16 insertions, 24 deletions
diff --git a/thread.h b/thread.h
index 035c5caec9..50d9fc382b 100644
--- a/thread.h
+++ b/thread.h
@@ -3,44 +3,36 @@
#ifdef WIN32
# include <win32thread.h>
#else
-
-#ifndef DJGPP
-/* POSIXish threads */
-#ifdef OLD_PTHREADS_API
-# define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
-# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
-# define pthread_key_create(k,d) pthread_keycreate(k,(pthread_destructor_t)(d))
-# define YIELD pthread_yield()
-# define DETACH(t) \
+# if defined(OLD_PTHREADS_API) && !defined(DJGPP)
+ /* POSIXish threads */
+# define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
+# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
+# define pthread_key_create(k,d) pthread_keycreate(k,(pthread_destructor_t)(d))
+# define DETACH(t) \
STMT_START { \
if (pthread_detach(&(t)->self)) { \
MUTEX_UNLOCK(&(t)->mutex); \
croak("panic: DETACH"); \
} \
} STMT_END
-#else
-# define pthread_mutexattr_default NULL
-# define pthread_condattr_default NULL
-#endif /* OLD_PTHREADS_API */
+# else
+# define pthread_mutexattr_default NULL
+# define pthread_condattr_default NULL
+# endif /* OLD_PTHREADS_API */
#endif
+
+#ifndef YIELD
+# define YIELD SCHED_YIELD
#endif
-#ifdef PTHREADS_CREATED_JOINABLE
+#ifdef PTHREAD_CREATE_JOINABLE
# define ATTR_JOINABLE PTHREAD_CREATE_JOINABLE
#else
# ifdef PTHREAD_CREATE_UNDETACHED
# define ATTR_JOINABLE PTHREAD_CREATE_UNDETACHED
# else
-# define ATTR_JOINABLE PTHREAD_CREATE_JOINABLE
-# endif
-#endif
-
-#ifndef YIELD
-# ifdef HAS_SCHED_YIELD
-# define YIELD sched_yield()
-# else
-# ifdef HAS_PTHREAD_YIELD
-# define YIELD pthread_yield()
+# ifdef __UNDETACHED
+# define ATTR_JOINABLE __UNDETACHED
# endif
# endif
#endif