]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Follow up to r1722914: since worker threads are joined in cleanup_zombies,
authorYann Ylavic <ylavic@apache.org>
Mon, 4 Jan 2016 16:56:28 +0000 (16:56 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 4 Jan 2016 16:56:28 +0000 (16:56 +0000)
they are not anymore detached nor joined elsewhere.

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

modules/http2/h2_io.c
modules/http2/h2_worker.c
modules/http2/h2_workers.c

index 2ff45b2c735429471e68b9932a1ee1d699f9a5a6..5a2ad8f8b6302140342cf4ed6b191698bd60ce99 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <assert.h>
 
+#include <apr_pools.h>
 #include <apr_thread_mutex.h>
 #include <apr_thread_cond.h>
 
index f3f2b9b5c09ced0e44e376f4729481f3b9de7d5f..775a486912b5519a83f53965363d9026c1542ea5 100644 (file)
@@ -101,19 +101,6 @@ static void* APR_THREAD_FUNC execute(apr_thread_t *thread, void *wctx)
     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,
@@ -147,7 +134,6 @@ h2_worker *h2_worker_create(int id,
             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);
     }
@@ -156,15 +142,15 @@ h2_worker *h2_worker_create(int id,
 
 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 */
index cc0a8dc10c89e64cc977e1669d8693ade6ccda22..7542daa69938c0999003f75bb87d3181dca06417 100644 (file)
@@ -246,7 +246,6 @@ h2_workers *h2_workers_create(server_rec *s, apr_pool_t *server_pool,
         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);