| 252 | } |
| 253 | |
| 254 | AP_DECLARE(apr_status_t) ap_mutex_register(apr_pool_t *pconf, |
| 255 | const char *type, |
| 256 | const char *default_dir, |
| 257 | apr_lockmech_e default_mech, |
| 258 | apr_int32_t options) |
| 259 | { |
| 260 | mutex_cfg_t *mxcfg = apr_pcalloc(pconf, sizeof *mxcfg); |
| 261 | |
| 262 | if ((options & ~(AP_MUTEX_ALLOW_NONE | AP_MUTEX_DEFAULT_NONE))) { |
| 263 | return APR_EINVAL; |
| 264 | } |
| 265 | |
| 266 | ap_mutex_init(pconf); /* in case this mod's pre-config ran before core's */ |
| 267 | |
| 268 | mxcfg->options = options; |
| 269 | if (options & AP_MUTEX_DEFAULT_NONE) { |
| 270 | mxcfg->none = 1; |
| 271 | } |
| 272 | mxcfg->dir = default_dir; /* usually NULL */ |
| 273 | mxcfg->mech = default_mech; /* usually APR_LOCK_DEFAULT */ |
| 274 | apr_hash_set(mxcfg_by_type, type, APR_HASH_KEY_STRING, mxcfg); |
| 275 | |
| 276 | return APR_SUCCESS; |
| 277 | } |
| 278 | |
| 279 | static int mutex_needs_file(apr_lockmech_e mech) |
| 280 | { |
no test coverage detected