summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorDavid Reid <dreid@apache.org>2001-12-25 03:30:53 +0100
committerDavid Reid <dreid@apache.org>2001-12-25 03:30:53 +0100
commit88b31284ffb4718bbb128744e9cd67121da3ef6b (patch)
tree269c3c385f86a5bb1a913b24bcc6f6f2243df33d /server
parentfix a horrible bug which caused scoreboard initialation to always exit (diff)
downloadapache2-88b31284ffb4718bbb128744e9cd67121da3ef6b.tar.xz
apache2-88b31284ffb4718bbb128744e9cd67121da3ef6b.zip
This allows platforms without the _NP locking palaver to build
the worker MPM. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92596 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--server/mpm/worker/mpm.h2
-rw-r--r--server/mpm/worker/worker.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/server/mpm/worker/mpm.h b/server/mpm/worker/mpm.h
index 5db57028f6..da992b56fc 100644
--- a/server/mpm/worker/mpm.h
+++ b/server/mpm/worker/mpm.h
@@ -73,7 +73,9 @@
#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())
diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c
index 5290528565..d9238ad7d6 100644
--- a/server/mpm/worker/worker.c
+++ b/server/mpm/worker/worker.c
@@ -1391,14 +1391,21 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
ap_lock_fname = apr_psprintf(_pconf, "%s.%" APR_OS_PROC_T_FMT,
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 */
+
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) {
@@ -1412,6 +1419,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
return 1;
}
}
+#endif /* APR_HAS_CREATE_LOCKS_NP */
if (!is_graceful) {
ap_run_pre_mpm(pconf, SB_SHARED);