Make PTHREAD_ATFORK() to croak if HAS_FORK, noop otherwise.
Jarkko Hietaniemi [Thu, 12 Jul 2001 23:35:06 +0000 (23:35 +0000)]
p4raw-id: //depot/perl@11337

thread.h

index 8f475a0..a82c01b 100644 (file)
--- a/thread.h
+++ b/thread.h
@@ -308,9 +308,15 @@ void Perl_atfork_unlock(void);
 #ifndef PTHREAD_ATFORK
 #  ifdef HAS_PTHREAD_ATFORK
 #    define PTHREAD_ATFORK(prepare,parent,child)               \
-      pthread_atfork(prepare,parent,child)
+       pthread_atfork(prepare,parent,child)
 #  else
-#    define PTHREAD_ATFORK(prepare,parent,child)
+#    ifdef HAS_FORK
+#      define PTHREAD_ATFORK(prepare,parent,child)             \
+        Perl_croak(aTHX_ "No pthread_atfork() -- fork() too unsafe");
+#    else
+#      define PTHREAD_ATFORK(prepare,parent,child)             \
+        NOOP
+#    endif
 #  endif
 #endif