diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2016-04-13 11:47:40 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2016-04-13 11:47:40 +0000 |
commit | 0bedffa612603ec6fc92f74c439344d6b9908a3d (patch) | |
tree | 05faad2d501c8fb62b5691eb7d283e31f01e629c /locks/netware | |
parent | 8c1d1c855bdcd13bbb38ac8adaea31ade45a392b (diff) | |
download | libapr-0bedffa612603ec6fc92f74c439344d6b9908a3d.tar.gz |
apr_os_proc_mutex_put_ex: Allow to specify whether the OS native
mutex should or not be cleaned up (destroyed) with the constructed
APR mutex (given pool), and default to not for the simple _put()
function.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1738925 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks/netware')
-rw-r--r-- | locks/netware/proc_mutex.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/locks/netware/proc_mutex.c b/locks/netware/proc_mutex.c index 95dc8f8f4..581b24350 100644 --- a/locks/netware/proc_mutex.c +++ b/locks/netware/proc_mutex.c @@ -150,6 +150,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex, APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_lockmech_e mech, + int register_cleanup, apr_pool_t *pool) { if (pool == NULL) { @@ -166,6 +167,11 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex, (*pmutex)->mutex = apr_pcalloc(pool, sizeof(apr_thread_mutex_t)); (*pmutex)->mutex->mutex = *ospmutex; (*pmutex)->mutex->pool = pool; + + if (register_cleanup) { + apr_pool_cleanup_register(pool, *pmutex, apr_proc_mutex_cleanup, + apr_pool_cleanup_null); + } return APR_SUCCESS; } @@ -173,6 +179,7 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex, apr_os_proc_mutex_t *ospmutex, apr_pool_t *pool) { - return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, pool); + return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT, + 0, pool); } |