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:42:15 UTC

svn commit: r1897446 - in /apr/apr/branches/1.8.x: ./ threadproc/beos/thread.c threadproc/netware/thread.c threadproc/os2/thread.c threadproc/unix/thread.c threadproc/win32/thread.c

Author: ylavic
Date: Tue Jan 25 10:42:15 2022
New Revision: 1897446

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


Merge r1897445 from trunk.
Submitted by: ylavic

Modified:
    apr/apr/branches/1.8.x/   (props changed)
    apr/apr/branches/1.8.x/threadproc/beos/thread.c
    apr/apr/branches/1.8.x/threadproc/netware/thread.c
    apr/apr/branches/1.8.x/threadproc/os2/thread.c
    apr/apr/branches/1.8.x/threadproc/unix/thread.c
    apr/apr/branches/1.8.x/threadproc/win32/thread.c

Propchange: apr/apr/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1897445

Modified: apr/apr/branches/1.8.x/threadproc/beos/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/threadproc/beos/thread.c?rev=1897446&r1=1897445&r2=1897446&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/beos/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/beos/thread.c Tue Jan 25 10:42: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)
@@ -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_exi
     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;

Modified: apr/apr/branches/1.8.x/threadproc/netware/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/threadproc/netware/thread.c?rev=1897446&r1=1897445&r2=1897446&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/netware/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/netware/thread.c Tue Jan 25 10:42: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)
@@ -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_
     if (thd->detached) {
         apr_pool_destroy(thd->pool);
     }
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     NXThreadExit(NULL);
     return APR_SUCCESS;
 }

Modified: apr/apr/branches/1.8.x/threadproc/os2/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/threadproc/os2/thread.c?rev=1897446&r1=1897445&r2=1897446&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/os2/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/os2/thread.c Tue Jan 25 10:42: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)
@@ -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_exi
     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 */
 }

Modified: apr/apr/branches/1.8.x/threadproc/unix/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/threadproc/unix/thread.c?rev=1897446&r1=1897445&r2=1897446&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/unix/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/unix/thread.c Tue Jan 25 10:42: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)
@@ -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_exi
     if (thd->detached) {
         apr_pool_destroy(thd->pool);
     }
-#ifdef APR_HAS_THREAD_LOCAL
-    current_thread = NULL;
-#endif
     pthread_exit(NULL);
     return APR_SUCCESS;
 }

Modified: apr/apr/branches/1.8.x/threadproc/win32/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/threadproc/win32/thread.c?rev=1897446&r1=1897445&r2=1897446&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/win32/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/win32/thread.c Tue Jan 25 10:42: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)
@@ -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;
 }