Commit 0d7b3b9d authored by Ondřej Surý's avatar Ondřej Surý

Merge branch '1336-1404-netmgr-destroy-tsan-fixes' into 'master'

Fix minor shutdown issues detected by TSAN

Closes #1404 and #1336

See merge request !2639
parents d0bc45be bf2cc19b
Pipeline #26441 passed with stages
in 1 minute and 37 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment