}
apr_thread_mutex_unlock(m->lock);
}
- workers_register(m);
return status;
}
h2_stream_pri_cmp *cmp, void *ctx)
{
apr_status_t status;
+ int was_empty = 0;
AP_DEBUG_ASSERT(m);
status = apr_thread_mutex_lock(m->lock);
status = h2_io_in_close(io);
}
+ was_empty = h2_tq_empty(m->q);
h2_tq_add(m->q, io->id, cmp, ctx);
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, m->c,
}
apr_thread_mutex_unlock(m->lock);
}
-
- if (status == APR_SUCCESS) {
+ if (status == APR_SUCCESS && was_empty) {
workers_register(m);
}
return status;
ap_log_error(APLOG_MARK, APLOG_TRACE3, status, workers->s,
"h2_workers: register mplx(%ld)", m->id);
if (in_list(workers, m)) {
+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, workers->s,
+ "h2_workers: already registered mplx(%ld)", m->id);
status = APR_EAGAIN;
}
else {
if (workers->idle_worker_count > 0) {
apr_thread_cond_signal(workers->mplx_added);
}
- else if (workers->worker_count < workers->max_size) {
+ else if (status == APR_SUCCESS
+ && workers->worker_count < workers->max_size) {
ap_log_error(APLOG_MARK, APLOG_TRACE3, 0, workers->s,
"h2_workers: got %d worker, adding 1",
workers->worker_count);
add_worker(workers);
}
-
- /* cleanup any zombie workers that may have accumulated */
- cleanup_zombies(workers, 0);
-
apr_thread_mutex_unlock(workers->lock);
}
return status;
H2_MPLX_REMOVE(m);
status = APR_SUCCESS;
}
- /* cleanup any zombie workers that may have accumulated */
- cleanup_zombies(workers, 0);
-
apr_thread_mutex_unlock(workers->lock);
}
return status;