]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
- Access netmgr worker->finished under worker lock only
authorWitold Kręcicki <wpk@culm.net>
Tue, 26 Nov 2019 14:21:25 +0000 (15:21 +0100)
committerWitold Kręcicki <wpk@culm.net>
Tue, 26 Nov 2019 14:21:25 +0000 (15:21 +0100)
- Join network worker thread to silence tsan

lib/isc/netmgr/netmgr.c

index 32569093a4b5359456df61a801bb9637d1374082..e8d330f008b75974031f4c0ac46cbcbb70ec0a10 100644 (file)
@@ -198,6 +198,7 @@ nm_destroy(isc_nm_t **mgr0) {
                int r = uv_loop_close(&mgr->workers[i].loop);
                INSIST(r == 0);
                isc_queue_destroy(mgr->workers[i].ievents);
+               isc_thread_join(mgr->workers[i].thread, NULL);
        }
 
        isc_condition_destroy(&mgr->wkstatecond);
@@ -424,9 +425,10 @@ nm_thread(void *worker0) {
                                atomic_store(&worker->mgr->paused, false);
                        }
                }
+               bool finished = worker->finished;
                UNLOCK(&worker->lock);
 
-               if (worker->finished) {
+               if (finished) {
                        /*
                         * We need to launch the loop one more time
                         * in UV_RUN_NOWAIT mode to make sure that