threads. We want to get the workers in the pool of available threads ASAP
to keep perform_idle_server_maintenance from thrashing and starting too
many processes prematurely. The code before this patch would dribble workers
into the worker pool over an extended period of time and this prevented
perform_idle_server_maintenance from accurately deciding when new processes
were needed.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94889
13f79535-47bb-0310-9956-
ffa450edef68
apr_status_t rv;
int i;
int threads_created = 0;
+ int listener_started = 0;
int loops;
int prev_threads_created;
clean_child_exit(APEXIT_CHILDFATAL);
}
threads_created++;
- if (threads_created == 1) {
- /* now that we have a worker thread, it makes sense to create
- * a listener thread (we don't want a listener without a worker!)
- */
- create_listener_thread(ts);
- }
+ }
+ /* Start the listener only when there are workers available */
+ if (!listener_started && threads_created) {
+ create_listener_thread(ts);
+ listener_started = 1;
}
if (start_thread_may_exit || threads_created == ap_threads_per_child) {
break;