]> granicus.if.org Git - apache/commitdiff
mpm_worker, mpm_prefork: follow up to r1635521.
authorYann Ylavic <ylavic@apache.org>
Mon, 17 Nov 2014 11:45:29 +0000 (11:45 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 17 Nov 2014 11:45:29 +0000 (11:45 +0000)
Use one dedicated accept mutex per listeners bucket.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640145 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/prefork/prefork.c
server/mpm/worker/worker.c

index daa8569cf239cf563170530303bb78eca7985a49..ab78c49bd22a4ccd669acbb8b50c7c348dc6348d 100644 (file)
@@ -1281,6 +1281,7 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
     int level_flags = 0;
     ap_listen_rec **listen_buckets;
     apr_status_t rv;
+    char id[16];
     int i;
 
     pconf = p;
@@ -1322,10 +1323,11 @@ static int prefork_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
                          "could not open pipe-of-death");
             return DONE;
         }
-        /* Initialize cross-process accept lock when safe accept is needed */
-        if ((rv = SAFE_ACCEPT(ap_proc_mutex_create(&all_buckets[i].mutex, NULL,
-                                                   AP_ACCEPT_MUTEX_TYPE, NULL,
-                                                   s, pconf, 0)))) {
+        /* Initialize cross-process accept lock (safe accept is needed only) */
+        if ((rv = SAFE_ACCEPT((apr_snprintf(id, sizeof id, "%i", i),
+                               ap_proc_mutex_create(&all_buckets[i].mutex,
+                                                    NULL, AP_ACCEPT_MUTEX_TYPE,
+                                                    id, s, pconf, 0))))) {
             ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
                          (startup ? NULL : s),
                          "could not create accept mutex");
index 0296e67f23b528a1dddcfb83b1ec463c30498190..890c825b31113cb36ada2c5c8720258fbe22de69 100644 (file)
@@ -2002,6 +2002,7 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
     int level_flags = 0;
     ap_listen_rec **listen_buckets;
     apr_status_t rv;
+    char id[16];
     int i;
 
     pconf = p;
@@ -2043,10 +2044,11 @@ static int worker_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
                          "could not open pipe-of-death");
             return DONE;
         }
-        /* Initialize cross-process accept lock when safe accept is needed */
-        if ((rv = SAFE_ACCEPT(ap_proc_mutex_create(&all_buckets[i].mutex, NULL,
-                                                   AP_ACCEPT_MUTEX_TYPE, NULL,
-                                                   s, pconf, 0)))) {
+        /* Initialize cross-process accept lock (safe accept is needed only) */
+        if ((rv = SAFE_ACCEPT((apr_snprintf(id, sizeof id, "%i", i),
+                               ap_proc_mutex_create(&all_buckets[i].mutex,
+                                                    NULL, AP_ACCEPT_MUTEX_TYPE,
+                                                    id, s, pconf, 0))))) {
             ap_log_error(APLOG_MARK, APLOG_CRIT | level_flags, rv,
                          (startup ? NULL : s),
                          "could not create accept mutex");