This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH MANIFEST, lib/ExtUtils/testlib.t] More Tests
[perl5.git] / thread.h
index a1e8fdc..309d388 100644 (file)
--- a/thread.h
+++ b/thread.h
@@ -1,4 +1,4 @@
-#if defined(USE_THREADS) || defined(USE_ITHREADS)
+#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
 
 #if defined(VMS)
 #include <builtins.h>
 #endif
 
 #ifndef PTHREAD_ATFORK
-#  define PTHREAD_ATFORK(prepare,parent,child)                 \
-    pthread_atfork(prepare,parent,child)
+#  ifdef HAS_PTHREAD_ATFORK
+#    define PTHREAD_ATFORK(prepare,parent,child)               \
+       pthread_atfork(prepare,parent,child)
+#  else
+#    define PTHREAD_ATFORK(prepare,parent,child)               \
+       NOOP
+#  endif
 #endif
 
 #ifndef THREAD_RET_TYPE
 #  define THREAD_RET_CAST(p)   ((void *)(p))
 #endif /* THREAD_RET */
 
-#if defined(USE_THREADS)
+#if defined(USE_5005THREADS)
 
 /* Accessor for per-thread SVs */
 #  define THREADSV(i) (thr->threadsvp[i])
@@ -366,8 +371,8 @@ typedef struct condpair {
 #define MgCONDP(mg) (&((condpair_t *)(mg->mg_ptr))->cond)
 #define MgOWNER(mg) ((condpair_t *)(mg->mg_ptr))->owner
 
-#endif /* USE_THREADS */
-#endif /* USE_THREADS || USE_ITHREADS */
+#endif /* USE_5005THREADS */
+#endif /* USE_5005THREADS || USE_ITHREADS */
 
 #ifndef MUTEX_LOCK
 #  define MUTEX_LOCK(m)
@@ -461,7 +466,3 @@ typedef struct condpair {
 #ifndef INIT_THREADS
 #  define INIT_THREADS NOOP
 #endif
-
-#ifndef PTHREAD_ATFORK
-#  define PTHREAD_ATFORK(prepare,parent,child) NOOP
-#endif