* The system mutex implementation to use for the accept mutex.
*/
#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
-extern apr_lockmech_e_np ap_accept_lock_mech;
+extern apr_lockmech_e ap_accept_lock_mech;
const char *ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy,
const char *arg);
#endif
tmpnam(client_lock_name);
sts = apr_lock_create(&client_lock, APR_READWRITE, APR_LOCKALL,
- client_lock_name, ctx);
+ APR_LOCK_DEFAULT, client_lock_name, ctx);
if (sts != APR_SUCCESS) {
log_error_and_cleanup("failed to create lock", sts, s);
return;
tmpnam(opaque_lock_name);
sts = apr_lock_create(&opaque_lock, APR_MUTEX, APR_LOCKALL,
- opaque_lock_name, ctx);
+ APR_LOCK_DEFAULT, opaque_lock_name, ctx);
if (sts != APR_SUCCESS) {
log_error_and_cleanup("failed to create lock", sts, s);
return;
proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL);
/* create the rewriting lockfiles in the parent */
- if ((rv = apr_lock_create (&rewrite_log_lock, APR_MUTEX, APR_LOCKALL,
- NULL, p)) != APR_SUCCESS) {
+ if ((rv = apr_lock_create(&rewrite_log_lock, APR_MUTEX, APR_LOCKALL,
+ APR_LOCK_DEFAULT, NULL, p)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
"mod_rewrite: could not create rewrite_log_lock");
return HTTP_INTERNAL_SERVER_ERROR;
lockname = ap_server_root_relative(p, lockname);
/* create the lockfile */
- rc = apr_lock_create (&rewrite_mapr_lock_acquire, APR_MUTEX, APR_LOCKALL, lockname, p);
+ rc = apr_lock_create(&rewrite_mapr_lock_acquire, APR_MUTEX, APR_LOCKALL,
+ APR_LOCK_DEFAULT, lockname, p);
if (rc != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
"mod_rewrite: Parent could not create RewriteLock "
if (mc->nMutexMode == SSL_MUTEXMODE_NONE)
return TRUE;
- if (apr_lock_create(&mc->pMutex, APR_MUTEX, APR_LOCKALL,
+ if (apr_lock_create(&mc->pMutex, APR_MUTEX, APR_LOCKALL, APR_LOCK_DEFAULT,
mc->szMutexFile, p) != APR_SUCCESS)
return FALSE;
return TRUE;
* in select at a time
*/
if ((rv = apr_lock_create(&accept_mutex, APR_MUTEX, APR_CROSS_PROCESS,
- NULL, pconf)) != APR_SUCCESS) {
+ APR_LOCK_DEFAULT, NULL, pconf)) != APR_SUCCESS) {
/* tsch tsch, can't have more than one thread in the accept loop
at a time so we need to fall on our sword... */
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
* locks the worker_thread_count so we have ana ccurate count...
*/
if ((rv = apr_lock_create(&worker_thread_count_mutex, APR_MUTEX, APR_CROSS_PROCESS,
- NULL, pconf)) != APR_SUCCESS) {
+ APR_LOCK_DEFAULT, NULL, pconf)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
"Couldn't create worker thread count lock");
return 1;
}
apr_pool_create(&thread_pool_parent, pchild);
apr_lock_create(&thread_pool_parent_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&idle_thread_count_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&worker_thread_count_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&pipe_of_death_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&thread_accept_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_threadattr_create(&worker_thread_attr, pchild);
apr_threadattr_detach_set(worker_thread_attr, 1);
ap_lock_fname = apr_psprintf(_pconf, "%s.%u",
ap_server_root_relative(_pconf, ap_lock_fname),
my_pid);
- rv = SAFE_ACCEPT(apr_lock_create_np(&process_accept_mutex, APR_MUTEX,
- APR_CROSS_PROCESS, ap_accept_lock_mech,
- ap_lock_fname, _pconf));
+ rv = SAFE_ACCEPT(apr_lock_create(&process_accept_mutex, APR_MUTEX,
+ APR_CROSS_PROCESS, ap_accept_lock_mech,
+ ap_lock_fname, _pconf));
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
"Couldn't create cross-process lock");
}
apr_pool_create(&thread_pool_parent, pchild);
apr_lock_create(&thread_pool_parent_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&idle_thread_count_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&worker_thread_count_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&pipe_of_death_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_lock_create(&thread_accept_mutex, APR_MUTEX, APR_INTRAPROCESS,
- NULL, pchild);
+ APR_LOCK_DEFAULT, NULL, pchild);
apr_threadattr_create(&worker_thread_attr, pchild);
apr_threadattr_detach_set(worker_thread_attr, 1);
ap_lock_fname = apr_psprintf(_pconf, "%s.%u",
ap_server_root_relative(_pconf, ap_lock_fname),
my_pid);
- rv = SAFE_ACCEPT(apr_lock_create_np(&process_accept_mutex, APR_MUTEX,
- APR_CROSS_PROCESS, ap_accept_lock_mech,
- ap_lock_fname, _pconf));
+ rv = SAFE_ACCEPT(apr_lock_create(&process_accept_mutex, APR_MUTEX,
+ APR_CROSS_PROCESS, ap_accept_lock_mech,
+ ap_lock_fname, _pconf));
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
"Couldn't create cross-process lock");
apr_status_t rv;
expand_lock_fname(p);
- rv = apr_lock_create_np(&accept_lock, APR_MUTEX, APR_CROSS_PROCESS,
- ap_accept_lock_mech, ap_lock_fname, p);
+ rv = apr_lock_create(&accept_lock, APR_MUTEX, APR_CROSS_PROCESS,
+ ap_accept_lock_mech, ap_lock_fname, p);
if (rv) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, "couldn't create accept mutex");
exit(APEXIT_INIT);
*/
static void accept_mutex_init(apr_pool_t *p)
{
- apr_status_t rc = apr_lock_create(&accept_mutex, APR_MUTEX, APR_INTRAPROCESS, NULL, p);
+ apr_status_t rc = apr_lock_create(&accept_mutex, APR_MUTEX, APR_INTRAPROCESS,
+ APR_LOCK_DEFAULT, NULL, p);
if (rc != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rc, ap_server_conf,
if (one_process) {
/* Single process mode */
apr_lock_create(&start_mutex, APR_MUTEX, APR_CROSS_PROCESS,
- signal_name_prefix, pconf);
+ APR_LOCK_DEFAULT, signal_name_prefix, pconf);
exit_event = CreateEvent(NULL, TRUE, FALSE, exit_event_name);
}
else {
ap_run_child_init(pchild, ap_server_conf);
allowed_globals.jobsemaphore = CreateSemaphore(NULL, 0, 1000000, NULL);
- apr_lock_create(&allowed_globals.jobmutex, APR_MUTEX, APR_INTRAPROCESS, NULL, pchild);
+ apr_lock_create(&allowed_globals.jobmutex, APR_MUTEX, APR_INTRAPROCESS,
+ APR_LOCK_DEFAULT, NULL, pchild);
/*
* Wait until we have permission to start accepting connections.
NULL,
0,
0); /* CONCURRENT ACTIVE THREADS */
- apr_lock_create(&qlock, APR_MUTEX, APR_INTRAPROCESS, NULL, pchild);
+ apr_lock_create(&qlock, APR_MUTEX, APR_INTRAPROCESS, APR_LOCK_DEFAULT,
+ NULL, pchild);
}
/*
* Ths start mutex is used during a restart to prevent more than one
* child process from entering the accept loop at once.
*/
- apr_lock_create(&start_mutex,APR_MUTEX, APR_CROSS_PROCESS, signal_name_prefix,
- ap_server_conf->process->pool);
+ apr_lock_create(&start_mutex,APR_MUTEX, APR_CROSS_PROCESS,
+ APR_LOCK_DEFAULT, signal_name_prefix,
+ ap_server_conf->process->pool);
}
}
else /* parent_pid != my_pid */
#define AP_MPM_WANT_SET_LOCKFILE
#define AP_MPM_WANT_SET_MAX_REQUESTS
#define AP_MPM_WANT_SET_COREDUMPDIR
-#if APR_HAS_CREATE_LOCKS_NP
#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
-#endif /* APR_HAS_CREATE_LOCKS_NP */
#define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
ap_server_root_relative(_pconf, ap_lock_fname),
ap_my_pid);
-#if APR_HAS_CREATE_LOCKS_NP
- rv = apr_proc_mutex_create_np(&accept_mutex, ap_lock_fname,
- ap_accept_lock_mech, _pconf);
-#else
- rv = apr_proc_mutex_create(&accept_mutex, ap_lock_fname, _pconf);
-#endif /* APR_HAS_CREATE_LOCKS_NP */
-
+ rv = apr_proc_mutex_create(&accept_mutex, ap_lock_fname,
+ ap_accept_lock_mech, _pconf);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
"Couldn't create accept lock");
return 1;
}
-#if APR_HAS_CREATE_LOCKS_NP
#if APR_USE_SYSVSEM_SERIALIZE
if (ap_accept_lock_mech == APR_LOCK_DEFAULT ||
ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
return 1;
}
}
-#endif /* APR_HAS_CREATE_LOCKS_NP */
if (!is_graceful) {
ap_run_pre_mpm(pconf, SB_SHARED);
#endif
#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
-apr_lockmech_e_np ap_accept_lock_mech = APR_LOCK_DEFAULT;
+apr_lockmech_e ap_accept_lock_mech = APR_LOCK_DEFAULT;
AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd,
void *dummy,
const char *arg)