You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2022/01/25 10:41:15 UTC

svn commit: r1897445 - in /apr/apr/trunk/threadproc: beos/thread.c netware/thread.c os2/thread.c unix/thread.c win32/thread.c

Author: ylavic
Date: Tue Jan 25 10:41:15 2022
New Revision: 1897445

URL: http://svn.apache.org/viewvc?rev=1897445&view=rev
Log:
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.


Modified:
    apr/apr/trunk/threadproc/beos/thread.c
    apr/apr/trunk/threadproc/netware/thread.c
    apr/apr/trunk/threadproc/os2/thread.c
    apr/apr/trunk/threadproc/unix/thread.c
    apr/apr/trunk/threadproc/win32/thread.c

Modified: apr/apr/trunk/threadproc/beos/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/beos/thread.c?rev=1897445&r1=1897444&r2=1897445&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/beos/thread.c (original)
+++ apr/apr/trunk/threadproc/beos/thread.c Tue Jan 25 10:41:15 2022
@@ -63,7 +63,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
 }
 
 #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)
@@ -81,9 +81,6 @@ static void *dummy_worker(void *opaque)
         apr_pool_destroy(thd->pool);
     }
 
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     return ret;
 }
 
@@ -212,9 +209,6 @@ APR_DECLARE(void) apr_thread_exit(apr_th
     if (thd->detached) {
         apr_pool_destroy(thd->pool);
     }
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     exit_thread ((status_t)(retval));
 }
 

Modified: apr/apr/trunk/threadproc/netware/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/netware/thread.c?rev=1897445&r1=1897444&r2=1897445&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/netware/thread.c (original)
+++ apr/apr/trunk/threadproc/netware/thread.c Tue Jan 25 10:41:15 2022
@@ -65,7 +65,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
 }
 
 #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,9 +83,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 @@ void 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);
 }
 

Modified: apr/apr/trunk/threadproc/os2/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/os2/thread.c?rev=1897445&r1=1897444&r2=1897445&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/os2/thread.c (original)
+++ apr/apr/trunk/threadproc/os2/thread.c Tue Jan 25 10:41:15 2022
@@ -69,7 +69,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
 }
 
 #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)
@@ -84,10 +84,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
 }
 
 
@@ -217,9 +213,6 @@ APR_DECLARE(void) apr_thread_exit(apr_th
     if (thd->attr->attr & APR_THREADATTR_DETACHED) {
         apr_pool_destroy(thd->pool);
     }
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     _endthread();
 }
 

Modified: apr/apr/trunk/threadproc/unix/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/unix/thread.c?rev=1897445&r1=1897444&r2=1897445&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/unix/thread.c (original)
+++ apr/apr/trunk/threadproc/unix/thread.c Tue Jan 25 10:41:15 2022
@@ -137,7 +137,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
 }
 
 #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)
@@ -155,9 +155,6 @@ static void *dummy_worker(void *opaque)
         apr_pool_destroy(thread->pool);
     }
 
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     return ret;
 }
 
@@ -290,9 +287,6 @@ APR_DECLARE(void) apr_thread_exit(apr_th
     if (thd->detached) {
         apr_pool_destroy(thd->pool);
     }
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     pthread_exit(NULL);
 }
 

Modified: apr/apr/trunk/threadproc/win32/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/win32/thread.c?rev=1897445&r1=1897444&r2=1897445&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/win32/thread.c (original)
+++ apr/apr/trunk/threadproc/win32/thread.c Tue Jan 25 10:41:15 2022
@@ -73,7 +73,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
 }
 
 #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)
@@ -92,9 +92,6 @@ static void *dummy_worker(void *opaque)
         apr_pool_destroy(thd->pool);
     }
 
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     return ret;
 }