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/24 14:18:04 UTC

svn commit: r1897420 - 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: Mon Jan 24 14:18:04 2022
New Revision: 1897420

URL: http://svn.apache.org/viewvc?rev=1897420&view=rev
Log:
apr_thread: Follow up to r1897179: abort_fn on apr_allocator_create() failure.


Merge r1897419 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:r1897419

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=1897420&r1=1897419&r2=1897420&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/beos/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/beos/thread.c Mon Jan 24 14:18:04 2022
@@ -92,6 +92,7 @@ static apr_status_t alloc_thread(apr_thr
                                  apr_pool_t *pool)
 {
     apr_status_t stat;
+    apr_abortfunc_t abort_fn = apr_pool_abort_get(pool);
     apr_allocator_t *allocator;
     apr_pool_t *p;
 
@@ -103,10 +104,11 @@ static apr_status_t alloc_thread(apr_thr
      */
     stat = apr_allocator_create(&allocator);
     if (stat != APR_SUCCESS) {
+        if (abort_fn)
+            abort_fn(stat);
         return stat;
     }
-    stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool),
-                                        allocator);
+    stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator);
     if (stat != APR_SUCCESS) {
         apr_allocator_destroy(allocator);
         return stat;

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=1897420&r1=1897419&r2=1897420&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/netware/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/netware/thread.c Mon Jan 24 14:18:04 2022
@@ -94,6 +94,7 @@ static apr_status_t alloc_thread(apr_thr
                                  apr_pool_t *pool)
 {
     apr_status_t stat;
+    apr_abortfunc_t abort_fn = apr_pool_abort_get(pool);
     apr_allocator_t *allocator;
     apr_pool_t *p;
 
@@ -105,10 +106,11 @@ static apr_status_t alloc_thread(apr_thr
      */
     stat = apr_allocator_create(&allocator);
     if (stat != APR_SUCCESS) {
+        if (abort_fn)
+            abort_fn(stat);
         return stat;
     }
-    stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool),
-                                        allocator);
+    stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator);
     if (stat != APR_SUCCESS) {
         apr_allocator_destroy(allocator);
         return stat;

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=1897420&r1=1897419&r2=1897420&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/os2/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/os2/thread.c Mon Jan 24 14:18:04 2022
@@ -97,6 +97,7 @@ static apr_status_t alloc_thread(apr_thr
                                  apr_pool_t *pool)
 {
     apr_status_t stat;
+    apr_abortfunc_t abort_fn = apr_pool_abort_get(pool);
     apr_allocator_t *allocator;
     apr_pool_t *p;
 
@@ -108,10 +109,11 @@ static apr_status_t alloc_thread(apr_thr
      */
     stat = apr_allocator_create(&allocator);
     if (stat != APR_SUCCESS) {
+        if (abort_fn)
+            abort_fn(stat);
         return stat;
     }
-    stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool),
-                                        allocator);
+    stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator);
     if (stat != APR_SUCCESS) {
         apr_allocator_destroy(allocator);
         return stat;

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=1897420&r1=1897419&r2=1897420&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/unix/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/unix/thread.c Mon Jan 24 14:18:04 2022
@@ -166,6 +166,7 @@ static apr_status_t alloc_thread(apr_thr
                                  apr_pool_t *pool)
 {
     apr_status_t stat;
+    apr_abortfunc_t abort_fn = apr_pool_abort_get(pool);
     apr_allocator_t *allocator;
     apr_pool_t *p;
 
@@ -177,10 +178,11 @@ static apr_status_t alloc_thread(apr_thr
      */
     stat = apr_allocator_create(&allocator);
     if (stat != APR_SUCCESS) {
+        if (abort_fn)
+            abort_fn(stat);
         return stat;
     }
-    stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool),
-                                        allocator);
+    stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator);
     if (stat != APR_SUCCESS) {
         apr_allocator_destroy(allocator);
         return stat;

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=1897420&r1=1897419&r2=1897420&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/threadproc/win32/thread.c (original)
+++ apr/apr/branches/1.8.x/threadproc/win32/thread.c Mon Jan 24 14:18:04 2022
@@ -103,6 +103,7 @@ static apr_status_t alloc_thread(apr_thr
                                  apr_pool_t *pool)
 {
     apr_status_t stat;
+    apr_abortfunc_t abort_fn = apr_pool_abort_get(pool);
     apr_allocator_t *allocator;
     apr_pool_t *p;
 
@@ -114,10 +115,11 @@ static apr_status_t alloc_thread(apr_thr
      */
     stat = apr_allocator_create(&allocator);
     if (stat != APR_SUCCESS) {
+        if (abort_fn)
+            abort_fn(stat);
         return stat;
     }
-    stat = apr_pool_create_unmanaged_ex(&p, apr_pool_abort_get(pool),
-                                        allocator);
+    stat = apr_pool_create_unmanaged_ex(&p, abort_fn, allocator);
     if (stat != APR_SUCCESS) {
         apr_allocator_destroy(allocator);
         return stat;