#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.
#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.
*/
#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
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
#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)
#define ap_thread_current_create apr_thread_current_create
-#else /* !APR_VERSION_AT_LEAST(1,8,0) */
+#else /* APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL) */
#if AP_HAS_THREAD_LOCAL
#endif
}
-#endif /* !APR_VERSION_AT_LEAST(1,8,0) */
+#endif /* APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL) */
static apr_status_t main_thread_cleanup(void *arg)
{
#endif
}
-#if AP_HAS_THREAD_LOCAL
+#if AP_HAS_THREAD_LOCAL && !defined(APREG_NO_THREAD_LOCAL)
struct apreg_tls {
match_data_pt data;
return tls->data;
}
-#else /* !AP_HAS_THREAD_LOCAL */
+#else /* AP_HAS_THREAD_LOCAL && !defined(APREG_NO_THREAD_LOCAL) */
static APR_INLINE match_data_pt get_match_data(apr_size_t size,
match_vector_pt small_vector,
return alloc_match_data(size, small_vector);
}
-#endif /* !AP_HAS_THREAD_LOCAL */
+#endif /* AP_HAS_THREAD_LOCAL && !defined(APREG_NO_THREAD_LOCAL) */
AP_DECLARE(int) ap_regexec(const ap_regex_t *preg, const char *string,
apr_size_t nmatch, ap_regmatch_t *pmatch,