summaryrefslogtreecommitdiff
path: root/miniperlmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'miniperlmain.c')
-rw-r--r--miniperlmain.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/miniperlmain.c b/miniperlmain.c
index 620fed78b2..2c924ebe2e 100644
--- a/miniperlmain.c
+++ b/miniperlmain.c
@@ -48,7 +48,16 @@ main(int argc, char **argv, char **env)
PERL_SYS_INIT3(&argc,&argv,&env);
-#ifdef USE_ITHREADS
+#if defined(USE_THREADS) || defined(USE_ITHREADS)
+ /* XXX Ideally, this should really be happening in perl_alloc() or
+ * perl_construct() to keep libperl.a transparently fork()-safe.
+ * It is currently done here only because Apache/mod_perl have
+ * problems due to lack of a call to cancel pthread_atfork()
+ * handlers when shared objects that contain the handlers may
+ * be dlclose()d. This forces applications that embed perl to
+ * call PTHREAD_ATFORK() explicitly, but if and only if it hasn't
+ * been called at least once before in the current process.
+ * --GSAR 2001-07-20 */
PTHREAD_ATFORK(Perl_atfork_lock,
Perl_atfork_unlock,
Perl_atfork_unlock);