summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-25 10:42:15 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-25 10:42:15 +0000
commitef906d4e41c38d257fc527c096b488741c83fbaf (patch)
treebe4c7131361f2e4f77754cdb7606baf8ab5ebb8b
parent12e6fafe5c99070241d8a2edba37ab3021c5f6a8 (diff)
downloadapr-ef906d4e41c38d257fc527c096b488741c83fbaf.tar.gz
apr_thread: Follow up to r1897207: Don't NULLify current_thread on exit.
It's not needed, when the thread exits it's not accessible anyway. Merge r1897445 from trunk. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1897446 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--threadproc/beos/thread.c8
-rw-r--r--threadproc/netware/thread.c8
-rw-r--r--threadproc/os2/thread.c9
-rw-r--r--threadproc/unix/thread.c8
-rw-r--r--threadproc/win32/thread.c5
5 files changed, 5 insertions, 33 deletions
diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
index 96789f604..961a2b180 100644
--- a/threadproc/beos/thread.c
+++ b/threadproc/beos/thread.c
@@ -63,7 +63,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
}
#ifdef APR_HAS_THREAD_LOCAL
-static APR_THREAD_LOCAL apr_thread_t *current_thread;
+static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
#endif
static void *dummy_worker(void *opaque)
@@ -80,9 +80,6 @@ static void *dummy_worker(void *opaque)
apr_pool_destroy(thd->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
return ret;
}
@@ -211,9 +208,6 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval
if (thd->detached) {
apr_pool_destroy(thd->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
exit_thread ((status_t)(retval));
/* This will never be reached... */
return APR_SUCCESS;
diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
index d626ce133..ff0fce9e5 100644
--- a/threadproc/netware/thread.c
+++ b/threadproc/netware/thread.c
@@ -65,7 +65,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
}
#ifdef APR_HAS_THREAD_LOCAL
-static APR_THREAD_LOCAL apr_thread_t *current_thread;
+static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
#endif
static void *dummy_worker(void *opaque)
@@ -82,9 +82,6 @@ static void *dummy_worker(void *opaque)
apr_pool_destroy(thd->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
return ret;
}
@@ -252,9 +249,6 @@ apr_status_t apr_thread_exit(apr_thread_t *thd,
if (thd->detached) {
apr_pool_destroy(thd->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
NXThreadExit(NULL);
return APR_SUCCESS;
}
diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
index 52afed3ff..7defce049 100644
--- a/threadproc/os2/thread.c
+++ b/threadproc/os2/thread.c
@@ -69,7 +69,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
}
#ifdef APR_HAS_THREAD_LOCAL
-static APR_THREAD_LOCAL apr_thread_t *current_thread;
+static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
#endif
static void dummy_worker(void *opaque)
@@ -83,10 +83,6 @@ static void dummy_worker(void *opaque)
if (thd->attr->attr & APR_THREADATTR_DETACHED) {
apr_pool_destroy(thread->pool);
}
-
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
}
@@ -216,9 +212,6 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval
if (thd->attr->attr & APR_THREADATTR_DETACHED) {
apr_pool_destroy(thd->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
_endthread();
return -1; /* If we get here something's wrong */
}
diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
index d4f13d964..3944e0879 100644
--- a/threadproc/unix/thread.c
+++ b/threadproc/unix/thread.c
@@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
}
#ifdef APR_HAS_THREAD_LOCAL
-static APR_THREAD_LOCAL apr_thread_t *current_thread;
+static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
#endif
static void *dummy_worker(void *opaque)
@@ -154,9 +154,6 @@ static void *dummy_worker(void *opaque)
apr_pool_destroy(thread->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
return ret;
}
@@ -289,9 +286,6 @@ APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd,
if (thd->detached) {
apr_pool_destroy(thd->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
pthread_exit(NULL);
return APR_SUCCESS;
}
diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
index 4a6741a72..5a7bff929 100644
--- a/threadproc/win32/thread.c
+++ b/threadproc/win32/thread.c
@@ -73,7 +73,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
}
#ifdef APR_HAS_THREAD_LOCAL
-static APR_THREAD_LOCAL apr_thread_t *current_thread;
+static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
#endif
static void *dummy_worker(void *opaque)
@@ -91,9 +91,6 @@ static void *dummy_worker(void *opaque)
apr_pool_destroy(thd->pool);
}
-#ifdef APR_HAS_THREAD_LOCAL
- current_thread = NULL;
-#endif
return ret;
}