summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-07-12 23:35:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-12 23:35:06 +0000
commitde992003099f76a2f2b1df9b7f937a2338296e9a (patch)
tree7b025fc5ea512f2a52a52f434c15a313946458a2 /thread.h
parent144e72cbb0a87482126af99f2a57642ab7151c4b (diff)
downloadperl-de992003099f76a2f2b1df9b7f937a2338296e9a.tar.gz
Make PTHREAD_ATFORK() to croak if HAS_FORK, noop otherwise.
p4raw-id: //depot/perl@11337
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/thread.h b/thread.h
index 8f475a0b7c..a82c01b61d 100644
--- 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