summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2009-11-25 15:26:25 +0000
committerJeff Trawick <trawick@apache.org>2009-11-25 15:26:25 +0000
commit64e1c93a7877f3364b62062f80d1d643a1c1fc41 (patch)
treeb90011ec36e66a943a070e2e8987cf47b23ec6e9
parent611528ee3f2f2cc9098cfff3ac6308c670cc6bfe (diff)
downloadapr-64e1c93a7877f3364b62062f80d1d643a1c1fc41.tar.gz
merge r884139 from trunk:
add apr_global_mutex_name(), for retrieving the name of the mechanism used by the underlying apr_proc_mutex_t declare NULL as the result for any future mechanisms that don't have an underlying apr_proc_mutex_t or equivalent git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@884141 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES6
-rw-r--r--include/apr_global_mutex.h9
-rw-r--r--locks/unix/global_mutex.c5
3 files changed, 18 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 99f7aed49..af3896ccf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,10 @@
-*- coding: utf-8 -*-
Changes for APR 1.4.0
- *) Add apr_global_mutex_lockfile() for finding the file, if any,
- associated with the mutex. [Jeff Trawick]
+ *) Add apr_global_mutex_lockfile() for retrieving the file, if any,
+ associated with the mutex. Add apr_global_mutex_name() for retrieving
+ the name of the lock mechanism used by the underlying proc mutex.
+ [Jeff Trawick]
*) Add apr_socket_atreadeof to determine whether the receive part of the
socket has been closed by the peer.
diff --git a/include/apr_global_mutex.h b/include/apr_global_mutex.h
index 142e887a0..db1930134 100644
--- a/include/apr_global_mutex.h
+++ b/include/apr_global_mutex.h
@@ -127,6 +127,14 @@ APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex);
APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex);
/**
+ * Display the name of the mutex, as it relates to the actual method used
+ * for the underlying apr_proc_mutex_t, if any. NULL is returned if
+ * there is no underlying apr_proc_mutex_t.
+ * @param mutex the name of the mutex
+ */
+APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex);
+
+/**
* Get the pool used by this global_mutex.
* @return apr_pool_t the pool
*/
@@ -147,6 +155,7 @@ APR_POOL_DECLARE_ACCESSOR(global_mutex);
#define apr_global_mutex_unlock apr_proc_mutex_unlock
#define apr_global_mutex_destroy apr_proc_mutex_destroy
#define apr_global_mutex_lockfile apr_proc_mutex_lockfile
+#define apr_global_mutex_name apr_proc_mutex_name
#define apr_global_mutex_pool_get apr_proc_mutex_pool_get
#endif
diff --git a/locks/unix/global_mutex.c b/locks/unix/global_mutex.c
index 63765c9f4..18de7e450 100644
--- a/locks/unix/global_mutex.c
+++ b/locks/unix/global_mutex.c
@@ -180,4 +180,9 @@ APR_DECLARE(const char *) apr_global_mutex_lockfile(apr_global_mutex_t *mutex)
return apr_proc_mutex_lockfile(mutex->proc_mutex);
}
+APR_DECLARE(const char *) apr_global_mutex_name(apr_global_mutex_t *mutex)
+{
+ return apr_proc_mutex_name(mutex->proc_mutex);
+}
+
APR_POOL_IMPLEMENT_ACCESSOR(global_mutex)