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:54:24 UTC

svn commit: r1897448 - in /apr/apr/branches/1.8.x: ./ include/apr_thread_proc.h 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:54:23 2022
New Revision: 1897448

URL: http://svn.apache.org/viewvc?rev=1897448&view=rev
Log:
apr_thread: Follow up to r1897207: Make APR_HAS_THREAD_LOCAL a boolean..

.. rather than a defined().


Merge r1897447 from trunk.
Submitted by: ylavic

Modified:
    apr/apr/branches/1.8.x/   (props changed)
    apr/apr/branches/1.8.x/include/apr_thread_proc.h
    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:r1897447

Modified: apr/apr/branches/1.8.x/include/apr_thread_proc.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/include/apr_thread_proc.h?rev=1897448&r1=1897447&r2=1897448&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/include/apr_thread_proc.h (original)
+++ apr/apr/branches/1.8.x/include/apr_thread_proc.h Tue Jan 25 10:54:23 2022
@@ -209,8 +209,6 @@ typedef enum {
 
 /* Thread Function definitions */
 
-#undef APR_HAS_THREAD_LOCAL
-
 #if APR_HAS_THREADS
 
 /**
@@ -228,6 +226,8 @@ typedef enum {
 
 #ifdef APR_THREAD_LOCAL
 #define APR_HAS_THREAD_LOCAL 1
+#else
+#define APR_HAS_THREAD_LOCAL 0
 #endif
 
 /**
@@ -426,7 +426,11 @@ APR_DECLARE(apr_status_t) apr_threadkey_
                                                 apr_status_t (*cleanup) (void *),
                                                 apr_threadkey_t *threadkey);
 
-#endif
+#else  /* APR_HAS_THREADS */
+
+#define APR_HAS_THREAD_LOCAL 0
+
+#endif /* APR_HAS_THREADS */
 
 /**
  * Create and initialize a new procattr variable

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=1897448&r1=1897447&r2=1897448&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:54:23 2022
@@ -62,7 +62,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
     return APR_ENOTIMPL;
 }
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
 static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
 #endif
 
@@ -71,7 +71,7 @@ static void *dummy_worker(void *opaque)
     apr_thread_t *thd = (apr_thread_t*)opaque;
     void *ret;
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = thd;
 #endif
 
@@ -177,7 +177,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
     (*current)->td = apr_os_thread_current();
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = *current;
 #endif
     return APR_SUCCESS;
@@ -185,7 +185,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
 APR_DECLARE(apr_thread_t *) apr_thread_current(void)
 {
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     return current_thread;
 #else
     return NULL;

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=1897448&r1=1897447&r2=1897448&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:54:23 2022
@@ -64,7 +64,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
     return APR_ENOTIMPL;
 }
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
 static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
 #endif
 
@@ -73,7 +73,7 @@ static void *dummy_worker(void *opaque)
     apr_thread_t *thd = (apr_thread_t *)opaque;
     void *ret;
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = thd;
 #endif
 
@@ -212,7 +212,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
     (*current)->td = apr_os_thread_current();
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = *current;
 #endif
     return APR_SUCCESS;
@@ -220,7 +220,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
 APR_DECLARE(apr_thread_t *) apr_thread_current(void)
 {
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     return current_thread;
 #else
     return NULL;

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=1897448&r1=1897447&r2=1897448&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:54:23 2022
@@ -68,13 +68,13 @@ APR_DECLARE(apr_status_t) apr_threadattr
     return APR_ENOTIMPL;
 }
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
 static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
 #endif
 
 static void dummy_worker(void *opaque)
 {
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
   current_thread = thread;
 #endif
 
@@ -180,7 +180,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
     (*current)->tid = apr_os_thread_current();
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = *current;
 #endif
     return APR_SUCCESS;
@@ -188,7 +188,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
 APR_DECLARE(apr_thread_t *) apr_thread_current(void)
 {
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     return current_thread;
 #else
     return NULL;

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=1897448&r1=1897447&r2=1897448&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:54:23 2022
@@ -136,7 +136,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
 #endif
 }
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
 static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
 #endif
 
@@ -145,7 +145,7 @@ static void *dummy_worker(void *opaque)
     apr_thread_t *thread = (apr_thread_t*)opaque;
     void *ret;
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = thread;
 #endif
 
@@ -253,7 +253,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
     *(*current)->td = apr_os_thread_current();
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = *current;
 #endif
     return APR_SUCCESS;
@@ -261,7 +261,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
 APR_DECLARE(apr_thread_t *) apr_thread_current(void)
 {
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     return current_thread;
 #else
     return NULL;

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=1897448&r1=1897447&r2=1897448&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:54:23 2022
@@ -72,7 +72,7 @@ APR_DECLARE(apr_status_t) apr_threadattr
     return APR_ENOTIMPL;
 }
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
 static APR_THREAD_LOCAL apr_thread_t *current_thread = NULL;
 #endif
 
@@ -81,7 +81,7 @@ static void *dummy_worker(void *opaque)
     apr_thread_t *thd = (apr_thread_t *)opaque;
     void *ret;
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = thd;
 #endif
 
@@ -203,7 +203,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
         (*new)->td = apr_os_thread_current();
     }
 
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = *current;
 #endif
     return APR_SUCCESS;
@@ -211,7 +211,7 @@ APR_DECLARE(apr_status_t) apr_thread_cur
 
 APR_DECLARE(apr_thread_t *) apr_thread_current(void)
 {
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     return current_thread;
 #else
     return NULL;
@@ -226,7 +226,7 @@ APR_DECLARE(apr_status_t) apr_thread_exi
     if (!thd->td) { /* detached? */
         apr_pool_destroy(thd->pool);
     }
-#ifdef APR_HAS_THREAD_LOCAL
+#if APR_HAS_THREAD_LOCAL
     current_thread = NULL;
 #endif
 #ifndef _WIN32_WCE