summaryrefslogtreecommitdiff
path: root/modules/ssl
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-25 17:34:57 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-25 17:34:57 +0000
commit604485905718803811a4b68cd2717a3712500d4a (patch)
treee4b7c189dacd6e94365d420edb5e59d01f4b965b /modules/ssl
parenta6f105f7d4451f64b98cff16804a0158ddd29bff (diff)
downloadhttpd-604485905718803811a4b68cd2717a3712500d4a.tar.gz
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 'modules/ssl')
-rw-r--r--modules/ssl/mod_ssl_ct.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/ssl/mod_ssl_ct.c b/modules/ssl/mod_ssl_ct.c
index f583da5f18..17b673a8e5 100644
--- a/modules/ssl/mod_ssl_ct.c
+++ b/modules/ssl/mod_ssl_ct.c
@@ -1123,8 +1123,8 @@ static int daemon_thread_start(apr_pool_t *pconf, server_rec *s_main)
apr_pool_create(&pdaemon, pconf);
apr_pool_tag(pdaemon, "sct_daemon");
- rv = apr_thread_create(&daemon_thread, NULL, sct_daemon_thread, s_main,
- pconf);
+ rv = ap_thread_create(&daemon_thread, NULL, sct_daemon_thread, s_main,
+ pconf);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s_main,
APLOGNO(02709) "could not create " DAEMON_THREAD_NAME
@@ -2522,7 +2522,7 @@ static void ssl_ct_child_init(apr_pool_t *p, server_rec *s)
exit(APEXIT_CHILDSICK);
}
- rv = apr_thread_create(&service_thread, NULL, run_service_thread, s, p);
+ rv = ap_thread_create(&service_thread, NULL, run_service_thread, s, p);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
APLOGNO(02745) "could not create " SERVICE_THREAD_NAME