From: Coral Date: Mon, 16 Jul 2001 14:25:19 +0000 (-0700) Subject: fix PTHREAD_ATFORK croaking too early, too often X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ff9412f9ef1dbdabee4f0993653e1446d7a88c8;p=p5sagit%2Fp5-mst-13.2.git fix PTHREAD_ATFORK croaking too early, too often Message-Id: <200107162125.f6GLPJ345261@moonlight.crystalflame.net> p4raw-id: //depot/perl@11392 --- diff --git a/pp_sys.c b/pp_sys.c index 0451d5a..6a74b11 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -3874,6 +3874,10 @@ PP(pp_fork) Pid_t childpid; GV *tmpgv; +# if defined(USE_ITHREADS) && !defined(HAS_PTHREAD_ATFORK) + Perl_croak(aTHX_ "No pthread_atfork() -- fork() too unsafe"); +# endif + EXTEND(SP, 1); PERL_FLUSHALL_FOR_CHILD; childpid = fork(); diff --git a/thread.h b/thread.h index a82c01b..3b26b17 100644 --- a/thread.h +++ b/thread.h @@ -310,13 +310,8 @@ void Perl_atfork_unlock(void); # define PTHREAD_ATFORK(prepare,parent,child) \ pthread_atfork(prepare,parent,child) # else -# 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 +# define PTHREAD_ATFORK(prepare,parent,child) \ + NOOP # endif #endif @@ -474,7 +469,3 @@ typedef struct condpair { #ifndef INIT_THREADS # define INIT_THREADS NOOP #endif - -#ifndef PTHREAD_ATFORK -# define PTHREAD_ATFORK(prepare,parent,child) NOOP -#endif