From 1ad655cf9e3871d272dc7e8e11cefab0c61b539d Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 4 Apr 2002 18:36:03 +0000 Subject: [PATCH] Added support for Posix semaphore-based mutex locking (AcceptMutex posixsem). It's between pthread and sysvsem in the DEFAULT priority ranking. This makes it the new default for Darwin, and adds support for it for other platforms as well (like Solaris). PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94434 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ server/main.c | 4 ++++ server/mpm_common.c | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/CHANGES b/CHANGES index 00e0c40e57..39fb332b5e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0.35 + *) Added support for Posix semaphore mutex locking (AcceptMutex posixsem) + for those platforms that support it. If using the default + implementation, this is between pthread and sysvsem in priority. + This implies it's the new default for Darwin. [Jim Jagielski] + *) AIX: Fix the syntax for setting the LDR_CNTRL and AIXTHREAD_SCOPE environment variables in the envvars file. [Jeff Trawick] diff --git a/server/main.c b/server/main.c index 6e313394bc..010aa52d45 100644 --- a/server/main.c +++ b/server/main.c @@ -145,6 +145,10 @@ static void show_compile_settings(void) printf(" -D APR_USE_SYSVSEM_SERIALIZE\n"); #endif +#if APR_USE_POSIXSEM_SERIALIZE + printf(" -D APR_USE_POSIXSEM_SERIALIZE\n"); +#endif + #if APR_USE_FCNTL_SERIALIZE printf(" -D APR_USE_FCNTL_SERIALIZE\n"); #endif diff --git a/server/mpm_common.c b/server/mpm_common.c index 4023dd043c..d0738dc9c5 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -672,6 +672,9 @@ const char ap_valid_accept_mutex_string[] = #if APR_HAS_SYSVSEM_SERIALIZE && !defined(PERCHILD_MPM) ", sysvsem" #endif +#if APR_HAS_POSIXSEM_SERIALIZE + ", posixsem" +#endif #if APR_HAS_PROC_PTHREAD_SERIALIZE ", pthread" #endif @@ -710,6 +713,11 @@ AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd, ap_accept_lock_mech = APR_LOCK_SYSVSEM; } #endif +#if APR_HAS_POSIXSEM_SERIALIZE + else if (!strcasecmp(arg, "posixsem")) { + ap_accept_lock_mech = APR_LOCK_POSIXSEM; + } +#endif #if APR_HAS_PROC_PTHREAD_SERIALIZE else if (!strcasecmp(arg, "pthread")) { ap_accept_lock_mech = APR_LOCK_PROC_PTHREAD; -- 2.40.0