From a3d78aae6ed5859177f225775a78e0c57f9aaa34 Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 25 Jan 2022 20:16:03 +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. Merge r1897470 from trunk. Submitted by: ylavic Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897471 13f79535-47bb-0310-9956-ffa450edef68 --- threadproc/netware/thread.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'threadproc/netware/thread.c') diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index fe66b46cf..019358a35 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -218,6 +218,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 -- cgit v1.2.1