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:16:05 UTC
svn commit: r1897419 - in /apr/apr/trunk/threadproc: beos/thread.c netware/thread.c os2/thread.c unix/thread.c win32/thread.c
Author: ylavic
Date: Mon Jan 24 14:16:04 2022
New Revision: 1897419
URL: http://svn.apache.org/viewvc?rev=1897419&view=rev
Log:
apr_thread: Follow up to r1897179: abort_fn on apr_allocator_create() failure.
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=1897419&r1=1897418&r2=1897419&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/beos/thread.c (original)
+++ apr/apr/trunk/threadproc/beos/thread.c Mon Jan 24 14:16:04 2022
@@ -93,6 +93,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;
@@ -104,10 +105,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/trunk/threadproc/netware/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/netware/thread.c?rev=1897419&r1=1897418&r2=1897419&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/netware/thread.c (original)
+++ apr/apr/trunk/threadproc/netware/thread.c Mon Jan 24 14:16:04 2022
@@ -95,6 +95,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;
@@ -106,10 +107,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/trunk/threadproc/os2/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/os2/thread.c?rev=1897419&r1=1897418&r2=1897419&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/os2/thread.c (original)
+++ apr/apr/trunk/threadproc/os2/thread.c Mon Jan 24 14:16:04 2022
@@ -98,6 +98,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;
@@ -109,10 +110,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/trunk/threadproc/unix/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/unix/thread.c?rev=1897419&r1=1897418&r2=1897419&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/unix/thread.c (original)
+++ apr/apr/trunk/threadproc/unix/thread.c Mon Jan 24 14:16:04 2022
@@ -167,6 +167,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;
@@ -178,10 +179,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/trunk/threadproc/win32/thread.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/threadproc/win32/thread.c?rev=1897419&r1=1897418&r2=1897419&view=diff
==============================================================================
--- apr/apr/trunk/threadproc/win32/thread.c (original)
+++ apr/apr/trunk/threadproc/win32/thread.c Mon Jan 24 14:16:04 2022
@@ -104,6 +104,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;
@@ -115,10 +116,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;