MCPcopy Create free account
hub / github.com/apache/httpd / ap_global_mutex_create

Function ap_global_mutex_create

server/util_mutex.c:407–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405#endif
406
407AP_DECLARE(apr_status_t) ap_global_mutex_create(apr_global_mutex_t **mutex,
408 const char **name,
409 const char *type,
410 const char *instance_id,
411 server_rec *s, apr_pool_t *p,
412 apr_int32_t options)
413{
414 apr_status_t rv;
415 const char *fname;
416 mutex_cfg_t *mxcfg = mxcfg_lookup(p, type);
417
418 if (options) {
419 log_bad_create_options(s, type);
420 return APR_EINVAL;
421 }
422
423 if (!mxcfg) {
424 log_unknown_type(s, type);
425 return APR_EINVAL;
426 }
427
428 if (mxcfg->none) {
429 *mutex = NULL;
430 return APR_SUCCESS;
431 }
432
433 fname = get_mutex_filename(p, mxcfg, type, instance_id);
434
435 rv = apr_global_mutex_create(mutex, fname, mxcfg->mech, p);
436 if (rv != APR_SUCCESS) {
437 log_create_failure(rv, s, type, fname);
438 return rv;
439 }
440
441 if (name)
442 *name = fname;
443
444#ifdef AP_NEED_SET_MUTEX_PERMS
445 rv = ap_unixd_set_global_mutex_perms(*mutex);
446 if (rv != APR_SUCCESS) {
447 log_perms_failure(rv, s, type);
448 }
449#endif
450
451 return rv;
452}
453
454AP_DECLARE(apr_status_t) ap_proc_mutex_create(apr_proc_mutex_t **mutex,
455 const char **name,

Callers 11

socache_post_configFunction · 0.85
initialize_tablesFunction · 0.85
authn_cache_post_configFunction · 0.85
proxy_post_configFunction · 0.85
balancer_post_configFunction · 0.85
rewritelock_createFunction · 0.85
ssl_stapling_mutex_initFunction · 0.85
ssl_mutex_initFunction · 0.85
exipc_post_configFunction · 0.85
util_ldap_post_configFunction · 0.85
lua_post_configFunction · 0.85

Calls 7

mxcfg_lookupFunction · 0.85
log_bad_create_optionsFunction · 0.85
log_unknown_typeFunction · 0.85
get_mutex_filenameFunction · 0.85
log_create_failureFunction · 0.85
log_perms_failureFunction · 0.85

Tested by

no test coverage detected