]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
core: Follow up to r1897460: Implement and use ap_thread_current_after_fork().
authorYann Ylavic <ylavic@apache.org>
Tue, 25 Jan 2022 20:28:28 +0000 (20:28 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 25 Jan 2022 20:28:28 +0000 (20:28 +0000)
commitaa95fe54f45cbd518a1d53bf9eda5cf17acc37f4
treef944de6e1c4546f48662ed01956ee9dce571adfe
parent15cf51108fe054a74c6b5846f81927725db16027
core: Follow up to r1897460: Implement and use ap_thread_current_after_fork().

thread_local variables are not (always?) reset on fork(), so we need a way
to set the current_thread to NULL in the child process.

Implement and use ap_thread_current_after_fork() for that.

* include/httpd.h:
  Define ap_thread_current_after_fork().

* server/util.c:
  Implement ap_thread_current_after_fork().

* server/mpm/event/event.c, server/mpm/prefork/prefork.c,
    server/mpm/worker/worker.c:
  Use ap_thread_current_after_fork().

* server/mpm/winnt/child.c:
  Windows processes are not fork()ed and each child runs the main(), so
  ap_thread_current_create() was already called there.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897472 13f79535-47bb-0310-9956-ffa450edef68
include/httpd.h
server/mpm/event/event.c
server/mpm/prefork/prefork.c
server/mpm/winnt/child.c
server/mpm/worker/worker.c
server/util.c