summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2023-03-20 16:27:15 +0000
committerYann Ylavic <ylavic@apache.org>2023-03-20 16:27:15 +0000
commitacf6a5debfb297907946012d7e36c45c873d32ed (patch)
treef25903496de3a1f4d5de50f04c66c894ac9c53f4
parent60956ac9fb3f5c6c5f332198a15bb6faa5b56c77 (diff)
downloadapr-acf6a5debfb297907946012d7e36c45c873d32ed.tar.gz
apr_thread: Follow up to r1897207: apr_thread_current_create() is ENOTIMPL w/o APR_HAS_THREAD_LOCAL.
It's useless when !APR_HAS_THREAD_LOCAL since apr_thread_current() can't work. Merges r1908417 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1908579 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--threadproc/beos/thread.c6
-rw-r--r--threadproc/netware/thread.c6
-rw-r--r--threadproc/os2/thread.c6
-rw-r--r--threadproc/unix/thread.c6
-rw-r--r--threadproc/win32/thread.c6
5 files changed, 20 insertions, 10 deletions
diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
index 0ca7131da..2afc8a7ec 100644
--- a/threadproc/beos/thread.c
+++ b/threadproc/beos/thread.c
@@ -165,6 +165,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
apr_threadattr_t *attr,
apr_pool_t *pool)
{
+#if APR_HAS_THREAD_LOCAL
apr_status_t stat;
*current = apr_thread_current();
@@ -180,10 +181,11 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
(*current)->td = apr_os_thread_current();
-#if APR_HAS_THREAD_LOCAL
current_thread = *current;
-#endif
return APR_SUCCESS;
+#else
+ return APR_ENOTIMPL;
+#endif
}
APR_DECLARE(void) apr_thread_current_after_fork(void)
diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
index 0672d4af6..2d4d5a0e9 100644
--- a/threadproc/netware/thread.c
+++ b/threadproc/netware/thread.c
@@ -200,6 +200,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
apr_threadattr_t *attr,
apr_pool_t *pool)
{
+#if APR_HAS_THREAD_LOCAL
apr_status_t stat;
*current = apr_thread_current();
@@ -215,10 +216,11 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
(*current)->td = apr_os_thread_current();
-#if APR_HAS_THREAD_LOCAL
current_thread = *current;
-#endif
return APR_SUCCESS;
+#else
+ return APR_ENOTIMPL;
+#endif
}
APR_DECLARE(void) apr_thread_current_after_fork(void)
diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
index 1f693950d..8f60a0a3a 100644
--- a/threadproc/os2/thread.c
+++ b/threadproc/os2/thread.c
@@ -168,6 +168,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
apr_threadattr_t *attr,
apr_pool_t *pool)
{
+#if APR_HAS_THREAD_LOCAL
apr_status_t stat;
*current = apr_thread_current();
@@ -183,10 +184,11 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
(*current)->tid = apr_os_thread_current();
-#if APR_HAS_THREAD_LOCAL
current_thread = *current;
-#endif
return APR_SUCCESS;
+#else
+ return APR_ENOTIMPL;
+#endif
}
APR_DECLARE(void) apr_thread_current_after_fork(void)
diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
index 5ec219e23..95271fe69 100644
--- a/threadproc/unix/thread.c
+++ b/threadproc/unix/thread.c
@@ -241,6 +241,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
apr_threadattr_t *attr,
apr_pool_t *pool)
{
+#if APR_HAS_THREAD_LOCAL
apr_status_t stat;
*current = apr_thread_current();
@@ -256,10 +257,11 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
*(*current)->td = apr_os_thread_current();
-#if APR_HAS_THREAD_LOCAL
current_thread = *current;
-#endif
return APR_SUCCESS;
+#else
+ return APR_ENOTIMPL;
+#endif
}
APR_DECLARE(void) apr_thread_current_after_fork(void)
diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
index 04b08b107..974a18487 100644
--- a/threadproc/win32/thread.c
+++ b/threadproc/win32/thread.c
@@ -189,6 +189,7 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
apr_threadattr_t *attr,
apr_pool_t *pool)
{
+#if APR_HAS_THREAD_LOCAL
apr_status_t stat;
*current = apr_thread_current();
@@ -206,10 +207,11 @@ APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
(*current)->td = apr_os_thread_current();
}
-#if APR_HAS_THREAD_LOCAL
current_thread = *current;
-#endif
return APR_SUCCESS;
+#else
+ return APR_ENOTIMPL;
+#endif
}
APR_DECLARE(void) apr_thread_current_after_fork(void)