You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2018/01/19 09:40:16 UTC

svn commit: r1821608 - in /httpd/httpd/trunk/server/mpm/worker: config3.m4 fdqueue.c fdqueue.h worker.c

Author: ylavic
Date: Fri Jan 19 09:40:16 2018
New Revision: 1821608

URL: http://svn.apache.org/viewvc?rev=1821608&view=rev
Log:
mpm_worker: Follow up to r1821526.

Use common fdqueue.


Removed:
    httpd/httpd/trunk/server/mpm/worker/fdqueue.c
    httpd/httpd/trunk/server/mpm/worker/fdqueue.h
Modified:
    httpd/httpd/trunk/server/mpm/worker/config3.m4
    httpd/httpd/trunk/server/mpm/worker/worker.c

Modified: httpd/httpd/trunk/server/mpm/worker/config3.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/config3.m4?rev=1821608&r1=1821607&r2=1821608&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/config3.m4 (original)
+++ httpd/httpd/trunk/server/mpm/worker/config3.m4 Fri Jan 19 09:40:16 2018
@@ -1,7 +1,7 @@
 APACHE_MPMPATH_INIT(worker)
 
 dnl ## XXX - Need a more thorough check of the proper flags to use
-APACHE_MPM_MODULE(worker, $enable_mpm_worker, worker.lo fdqueue.lo,[
+APACHE_MPM_MODULE(worker, $enable_mpm_worker, worker.lo,[
     AC_CHECK_FUNCS(pthread_kill)
 ])
 

Modified: httpd/httpd/trunk/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?rev=1821608&r1=1821607&r2=1821608&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/worker.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/worker.c Fri Jan 19 09:40:16 2018
@@ -64,7 +64,7 @@
 #include "mpm_common.h"
 #include "ap_listen.h"
 #include "scoreboard.h"
-#include "fdqueue.h"
+#include "mpm_unix.h"
 #include "mpm_default.h"
 #include "util_mutex.h"
 #include "unixd.h"
@@ -597,11 +597,7 @@ static void * APR_THREAD_FUNC listener_t
         if (listener_may_exit) break;
 
         if (!have_idle_worker) {
-            /* the following pops a recycled ptrans pool off a stack
-             * if there is one, in addition to reserving a worker thread
-             */
-            rv = ap_queue_info_wait_for_idler(worker_queue_info,
-                                              &ptrans);
+            rv = ap_queue_info_wait_for_idler(worker_queue_info, NULL);
             if (APR_STATUS_IS_EOF(rv)) {
                 break; /* we've been signaled to die now */
             }
@@ -679,6 +675,8 @@ static void * APR_THREAD_FUNC listener_t
         } /* if/else */
 
         if (!listener_may_exit) {
+            /* the following pops a recycled ptrans pool off a stack */
+            ap_pop_pool(&ptrans, worker_queue_info);
             if (ptrans == NULL) {
                 /* we can't use a recycled transaction pool this time.
                  * create a new transaction pool */
@@ -688,8 +686,8 @@ static void * APR_THREAD_FUNC listener_t
                 apr_allocator_max_free_set(allocator, ap_max_mem_free);
                 apr_pool_create_ex(&ptrans, pconf, NULL, allocator);
                 apr_allocator_owner_set(allocator, ptrans);
+                apr_pool_tag(ptrans, "transaction");
             }
-            apr_pool_tag(ptrans, "transaction");
             rv = lr->accept_func(&csd, lr, ptrans);
             /* later we trash rv and rely on csd to indicate success/failure */
             AP_DEBUG_ASSERT(rv == APR_SUCCESS || !csd);
@@ -712,7 +710,7 @@ static void * APR_THREAD_FUNC listener_t
                 accept_mutex_error("unlock", rv, process_slot);
             }
             if (csd != NULL) {
-                rv = ap_queue_push(worker_queue, csd, ptrans);
+                rv = ap_queue_push(worker_queue, csd, NULL, ptrans);
                 if (rv) {
                     /* trash the connection; we couldn't queue the connected
                      * socket to a worker
@@ -918,7 +916,7 @@ static void * APR_THREAD_FUNC start_thre
     }
 
     rv = ap_queue_info_create(&worker_queue_info, pchild,
-                              threads_per_child);
+                              threads_per_child, -1);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, rv, ap_server_conf, APLOGNO(03141)
                      "ap_queue_info_create() failed");