You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2009/11/25 16:22:59 UTC

svn commit: r884139 - in /apr/apr/trunk: include/apr_global_mutex.h locks/unix/global_mutex.c

Author: trawick
Date: Wed Nov 25 15:22:59 2009
New Revision: 884139

URL: http://svn.apache.org/viewvc?rev=884139&view=rev
Log:
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

Modified:
    apr/apr/trunk/include/apr_global_mutex.h
    apr/apr/trunk/locks/unix/global_mutex.c

Modified: apr/apr/trunk/include/apr_global_mutex.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_global_mutex.h?rev=884139&r1=884138&r2=884139&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_global_mutex.h (original)
+++ apr/apr/trunk/include/apr_global_mutex.h Wed Nov 25 15:22:59 2009
@@ -128,6 +128,14 @@
 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);
+
+/**
  * Set mutex permissions.
  */
 APR_PERMS_SET_IMPLEMENT(global_mutex);
@@ -153,6 +161,7 @@
 #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

Modified: apr/apr/trunk/locks/unix/global_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/locks/unix/global_mutex.c?rev=884139&r1=884138&r2=884139&view=diff
==============================================================================
--- apr/apr/trunk/locks/unix/global_mutex.c (original)
+++ apr/apr/trunk/locks/unix/global_mutex.c Wed Nov 25 15:22:59 2009
@@ -180,6 +180,11 @@
     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_PERMS_SET_IMPLEMENT(global_mutex)
 {
     apr_status_t rv;