diff options
author | Yann Ylavic <ylavic@apache.org> | 2022-01-25 18:34:57 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2022-01-25 18:34:57 +0100 |
commit | 604485905718803811a4b68cd2717a3712500d4a (patch) | |
tree | e4b7c189dacd6e94365d420edb5e59d01f4b965b /include/ap_mmn.h | |
parent | ap_regex: Follow up to r1897240: #if APR_HAS_THREAD_LOCAL, not #ifdef. (diff) | |
download | apache2-604485905718803811a4b68cd2717a3712500d4a.tar.xz apache2-604485905718803811a4b68cd2717a3712500d4a.zip |
core: Efficient ap_thread_current() when apr_thread_local() is missing.
#define ap_thread_create, ap_thread_current_create and ap_thread_current to
their apr-1.8+ equivalent if available, or implement them using the compiler's
thread_local mechanism if available, or finally provide stubs otherwise.
#define AP_HAS_THREAD_LOCAL to 1 in the two former case or 0 otherwise, while
AP_THREAD_LOCAL is defined to the compiler's keyword iff AP_HAS_THREAD_LOCAL.
Replace all apr_thread_create() calls with ap_thread_create() so that httpd
threads can use ap_thread_current()'s pool data as Thread Local Storage.
Bump MMN minor.
* include/httpd.h():
Define AP_HAS_THREAD_LOCAL, AP_THREAD_LOCAL (eventually), ap_thread_create(),
ap_thread_current_create() and ap_thread_current().
* server/util.c:
Implement ap_thread_create(), ap_thread_current_create() and
ap_thread_current() when APR < 1.8.
* modules/core/mod_watchdog.c, modules/http2/h2_workers.c,
modules/ssl/mod_ssl_ct.c:
Use ap_thread_create() instead of apr_thread_create.
* server/main.c:
Use AP_HAS_THREAD_LOCAL and ap_thread_current_create instead of APR's.
* server/util_pcre.c:
Use AP_HAS_THREAD_LOCAL and ap_thread_current instead of APR's.
* server/mpm/event/event.c, server/mpm/worker/worker.c,
server/mpm/prefork/prefork.c:
Use ap_thread_create() instead of apr_thread_create.
Create an apr_thread_t/ap_thread_current() for the main chaild thread usable
at child_init().
* server/mpm/winnt/child.c:
Use ap_thread_create() instead of CreateThread().
Create an apr_thread_t/ap_thread_current() for the main chaild thread usable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897460 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/ap_mmn.h')
-rw-r--r-- | include/ap_mmn.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 25709472db..6e35c4fee1 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -700,7 +700,9 @@ * add PROXY_WORKER_UDS_PATH_SIZE. * 20211221.1 (2.5.1-dev) Add read_line to scoreboard. * 20211221.2 (2.5.1-dev) Add AGAIN, AP_MPMQ_CAN_AGAIN. - * + * 20211221.3 (2.5.1-dev) Add ap_thread_create(), ap_thread_current_create() + * and ap_thread_current() + * */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -708,7 +710,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20211221 #endif -#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a |