Author: wrowe
Date: Tue May 4 17:36:57 2010
New Revision: 940979
URL: http://svn.apache.org/viewvc?rev=940979&view=rev
Log:
It is not inconvenient to return the derived filename here, let's
save the caller later hassle in looking this up, if they like.
Modified:
httpd/httpd/trunk/include/util_mutex.h
httpd/httpd/trunk/server/util_mutex.c
Modified: httpd/httpd/trunk/include/util_mutex.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/util_mutex.h?rev=940979&r1=940978&r2=940979&view=diff
==============================================================================
--- httpd/httpd/trunk/include/util_mutex.h (original)
+++ httpd/httpd/trunk/include/util_mutex.h Tue May 4 17:36:57 2010
@@ -167,20 +167,23 @@ AP_DECLARE(apr_status_t) ap_mutex_regist
* 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
* 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
Modified: httpd/httpd/trunk/server/util_mutex.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_mutex.c?rev=940979&r1=940978&r2=940979&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_mutex.c (original)
+++ httpd/httpd/trunk/server/util_mutex.c Tue May 4 17:36:57 2010
@@ -406,6 +406,7 @@ static void log_perms_failure(apr_status
}
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
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_c
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;
}
|