summaryrefslogtreecommitdiff
path: root/threadproc/unix
diff options
context:
space:
mode:
Diffstat (limited to 'threadproc/unix')
-rw-r--r--threadproc/unix/proc.c3
-rw-r--r--threadproc/unix/thread.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index 004772ff8..553d2578d 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -226,6 +226,9 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
return errno;
}
else if (pid == 0) {
+#if AP_HAS_THREAD_LOCAL
+ apr_thread_current_after_fork();
+#endif
proc->pid = getpid();
apr_random_after_fork(proc);
diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
index 504cbb4e9..05eb689b8 100644
--- a/threadproc/unix/thread.c
+++ b/threadproc/unix/thread.c
@@ -259,6 +259,13 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
return APR_SUCCESS;
}
+APR_DECLARE(void) apr_thread_current_after_fork(void)
+{
+#if APR_HAS_THREAD_LOCAL
+ current_thread = NULL;
+#endif
+}
+
APR_DECLARE(apr_thread_t *) apr_thread_current(void)
{
#if APR_HAS_THREAD_LOCAL