summaryrefslogtreecommitdiff
path: root/locks/os2
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2016-04-13 11:47:40 +0000
committerYann Ylavic <ylavic@apache.org>2016-04-13 11:47:40 +0000
commit391dd40f45fbcac7eef01698c5aacbb426e5dd17 (patch)
tree05faad2d501c8fb62b5691eb7d283e31f01e629c /locks/os2
parent2620df82b1b400caace45babcb0879cfe123d0f9 (diff)
downloadapr-391dd40f45fbcac7eef01698c5aacbb426e5dd17.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: https://svn.apache.org/repos/asf/apr/apr/trunk@1738925 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks/os2')
-rw-r--r--locks/os2/proc_mutex.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/locks/os2/proc_mutex.c b/locks/os2/proc_mutex.c
index 83f64c848..847f775da 100644
--- a/locks/os2/proc_mutex.c
+++ b/locks/os2/proc_mutex.c
@@ -268,6 +268,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)
{
apr_proc_mutex_t *new;
@@ -285,6 +286,10 @@ APR_DECLARE(apr_status_t) apr_os_proc_mutex_put_ex(apr_proc_mutex_t **pmutex,
new->hMutex = *ospmutex;
*pmutex = new;
+ if (register_cleanup) {
+ apr_pool_cleanup_register(pool, *pmutex, apr_proc_mutex_cleanup,
+ apr_pool_cleanup_null);
+ }
return APR_SUCCESS;
}
@@ -292,6 +297,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_TIMED, pool);
+ return apr_os_proc_mutex_put_ex(pmutex, ospmutex, APR_LOCK_DEFAULT_TIMED,
+ 0, pool);
}