return NULL;
}
-static apr_status_t cleanup_join_thread(void *ctx)
-{
- h2_worker *w = ctx;
- /* do the join only when the worker is aborted. Otherwise,
- * we are probably in a process shutdown.
- */
- if (w->thread && w->aborted) {
- apr_status_t rv;
- apr_thread_join(&rv, w->thread);
- }
- return APR_SUCCESS;
-}
-
h2_worker *h2_worker_create(int id,
apr_pool_t *parent_pool,
apr_threadattr_t *attr,
return NULL;
}
- apr_pool_pre_cleanup_register(w->pool, w, cleanup_join_thread);
apr_pool_create(&w->task_pool, w->pool);
apr_thread_create(&w->thread, attr, execute, w, w->pool);
}
apr_status_t h2_worker_destroy(h2_worker *worker)
{
- if (worker->io) {
- apr_thread_cond_destroy(worker->io);
- worker->io = NULL;
- }
if (worker->thread) {
apr_status_t status;
apr_thread_join(&status, worker->thread);
worker->thread = NULL;
}
+ if (worker->io) {
+ apr_thread_cond_destroy(worker->io);
+ worker->io = NULL;
+ }
if (worker->pool) {
apr_pool_destroy(worker->pool);
/* worker is gone */
apr_atomic_set32(&workers->max_idle_secs, 10);
apr_threadattr_create(&workers->thread_attr, workers->pool);
- apr_threadattr_detach_set(workers->thread_attr, 1);
if (ap_thread_stacksize != 0) {
apr_threadattr_stacksize_set(workers->thread_attr,
ap_thread_stacksize);