diff options
author | Yann Ylavic <ylavic@apache.org> | 2022-02-02 11:02:26 +0100 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2022-02-02 11:02:26 +0100 |
commit | 7833dc9148c549040eee27ddc90dda8cf28dcf4d (patch) | |
tree | fa58a0e1c8a88d7639ba94c972eda4cbb792b288 /include/httpd.h | |
parent | main: Follow up to r1897240: Fix bad log copypasta. (diff) | |
download | apache2-7833dc9148c549040eee27ddc90dda8cf28dcf4d.tar.xz apache2-7833dc9148c549040eee27ddc90dda8cf28dcf4d.zip |
core: Follow up to r1897240: Opt-out for AP_HAS_THREAD_LOCAL and/or pcre's usage.
If the compiler's thread_local is not efficient enough on some platforms, or
not desired, have a way to disable its usage in httpd (at compile time).
Handle -DAP_NO_THREAD_LOCAL and/or -DAPREG_NO_THREAD_LOCAL as build opt-out for
thread_local usage in httpd gobally and/or in ap_regex only (respectively).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897689 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/httpd.h')
-rw-r--r-- | include/httpd.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/httpd.h b/include/httpd.h index 96618c282a..86456d4afd 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -2566,7 +2566,7 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size) #if APR_HAS_THREADS -#if APR_VERSION_AT_LEAST(1,8,0) +#if APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL) /** * APR 1.8+ implement those already. @@ -2581,8 +2581,9 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size) #define ap_thread_current apr_thread_current #define ap_thread_current_after_fork apr_thread_current_after_fork -#else /* !APR_VERSION_AT_LEAST(1,8,0) */ +#else /* APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL) */ +#ifndef AP_NO_THREAD_LOCAL /** * AP_THREAD_LOCAL keyword mapping the compiler's. */ @@ -2595,6 +2596,7 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size) #elif defined(WIN32) && defined(_MSC_VER) #define AP_THREAD_LOCAL __declspec(thread) #endif +#endif /* ndef AP_NO_THREAD_LOCAL */ #ifndef AP_THREAD_LOCAL #define AP_HAS_THREAD_LOCAL 0 @@ -2610,16 +2612,16 @@ AP_DECLARE(apr_status_t) ap_thread_create(apr_thread_t **thread, AP_DECLARE(void) ap_thread_current_after_fork(void); AP_DECLARE(apr_thread_t *) ap_thread_current(void); -#endif /* !APR_VERSION_AT_LEAST(1,8,0) */ +#endif /* APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL) */ AP_DECLARE(apr_status_t) ap_thread_main_create(apr_thread_t **thread, apr_pool_t *pool); -#else /* !APR_HAS_THREADS */ +#else /* APR_HAS_THREADS */ #define AP_HAS_THREAD_LOCAL 0 -#endif /* !APR_HAS_THREADS */ +#endif /* APR_HAS_THREADS */ /** * Get server load params |