]> granicus.if.org Git - apache/commitdiff
It is not inconvenient to return the derived filename here, let's
authorWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 4 May 2010 17:36:57 +0000 (17:36 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Tue, 4 May 2010 17:36:57 +0000 (17:36 +0000)
save the caller later hassle in looking this up, if they like.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@940979 13f79535-47bb-0310-9956-ffa450edef68

include/util_mutex.h
server/util_mutex.c

index 935e94e998e3f1c6e4b224100eea5fba3ac61324..2043e973898e16ba4e39d962930209c64f9438a9 100644 (file)
@@ -167,20 +167,23 @@ AP_DECLARE(apr_status_t) ap_mutex_register(apr_pool_t *pconf,
  * stored.  If this mutex is disabled, mutex will be set to NULL on
  * output.  (That is allowed only if the AP_MUTEX_ALLOW_NONE flag is
  * passed to ap_mutex_register().)
+ * @param name The generated filename of the created mutex, or NULL if 
+ * no file was created.  Pass NULL if this result is not needed.
  * @param type The type name of the mutex, matching the type name passed
  * to ap_mutex_register().
  * @param instance_id A unique string to be used in the lock filename IFF
  * this mutex type is multi-instance, NULL otherwise.
- * @param s server_rec of main server
- * @param pconf pool
+ * @param server server_rec of main server
+ * @param pool pool lifetime of the mutex
  * @param options combination of AP_MUTEX_* constants, or 0 for defaults
  * (currently none are defined for this function)
  */
 AP_DECLARE(apr_status_t) ap_global_mutex_create(apr_global_mutex_t **mutex,
+                                                const char **name,
                                                 const char *type,
                                                 const char *instance_id,
-                                                server_rec *s,
-                                                apr_pool_t *pconf,
+                                                server_rec *server,
+                                                apr_pool_t *pool,
                                                 apr_int32_t options);
 
 /**
@@ -191,19 +194,23 @@ AP_DECLARE(apr_status_t) ap_global_mutex_create(apr_global_mutex_t **mutex,
  * stored.  If this mutex is disabled, mutex will be set to NULL on
  * output.  (That is allowed only if the AP_MUTEX_ALLOW_NONE flag is
  * passed to ap_mutex_register().)
+ * @param name The generated filename of the created mutex, or NULL if 
+ * no file was created.  Pass NULL if this result is not needed.
  * @param type The type name of the mutex, matching the type name passed
  * to ap_mutex_register().
  * @param instance_id A unique string to be used in the lock filename IFF
  * this mutex type is multi-instance, NULL otherwise.
- * @param s server_rec of main server
- * @param pconf pool
+ * @param server server_rec of main server
+ * @param pool pool lifetime of the mutex
  * @param options combination of AP_MUTEX_* constants, or 0 for defaults
  * (currently none are defined for this function)
  */
 AP_DECLARE(apr_status_t) ap_proc_mutex_create(apr_proc_mutex_t **mutex,
+                                              const char **name,
                                               const char *type,
                                               const char *instance_id,
-                                              server_rec *s, apr_pool_t *p,
+                                              server_rec *server,
+                                              apr_pool_t *pool,
                                               apr_int32_t options);
 
 #ifdef __cplusplus
index 45f93b48a5706e418394a751e731a460c5b6f56c..5896bf93a8beb28f03e2d1a2534329efe90f4b73 100644 (file)
@@ -406,6 +406,7 @@ static void log_perms_failure(apr_status_t rv, server_rec *s, const char *type)
 }
 
 AP_DECLARE(apr_status_t) ap_global_mutex_create(apr_global_mutex_t **mutex,
+                                                const char **name,
                                                 const char *type,
                                                 const char *instance_id,
                                                 server_rec *s, apr_pool_t *p,
@@ -438,18 +439,21 @@ AP_DECLARE(apr_status_t) ap_global_mutex_create(apr_global_mutex_t **mutex,
         return rv;
     }
 
+    if (name)
+        *name = fname;
+
 #ifdef AP_NEED_SET_MUTEX_PERMS
     rv = ap_unixd_set_global_mutex_perms(*mutex);
     if (rv != APR_SUCCESS) {
         log_perms_failure(rv, s, type);
-        return rv;
     }
 #endif
 
-    return APR_SUCCESS;
+    return rv;
 }
 
 AP_DECLARE(apr_status_t) ap_proc_mutex_create(apr_proc_mutex_t **mutex,
+                                              const char **name,
                                               const char *type,
                                               const char *instance_id,
                                               server_rec *s, apr_pool_t *p,
@@ -482,13 +486,15 @@ AP_DECLARE(apr_status_t) ap_proc_mutex_create(apr_proc_mutex_t **mutex,
         return rv;
     }
 
+    if (name)
+        *name = fname;
+
 #ifdef AP_NEED_SET_MUTEX_PERMS
     rv = ap_unixd_set_proc_mutex_perms(*mutex);
     if (rv != APR_SUCCESS) {
         log_perms_failure(rv, s, type);
-        return rv;
     }
 #endif
 
-    return APR_SUCCESS;
+    return rv;
 }