From 865e0f3805b4f46d77a43bc661fd793dbaaa7ff6 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 25 Jan 2022 20:14:55 +0000 Subject: apr_thread: Follow up to r1897207: Provide apr_thread_current_after_fork(). thread_local variables are not (always?) reset on fork(), so APR (and the user) needs a way to set the current_thread to NULL. Use apr_thread_current_after_fork() in apr_proc_fork()'s child process. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897470 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/unix/proc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'threadproc/unix/proc.c') diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index ed7a05fda..ad31c814f 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -234,6 +234,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(); /* Do the work needed for children PRNG(s). */ -- cgit v1.2.1