mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 23:25:38 +00:00
- Access netmgr worker->finished under worker lock only
- Join network worker thread to silence tsan
This commit is contained in:
@@ -198,6 +198,7 @@ nm_destroy(isc_nm_t **mgr0) {
|
|||||||
int r = uv_loop_close(&mgr->workers[i].loop);
|
int r = uv_loop_close(&mgr->workers[i].loop);
|
||||||
INSIST(r == 0);
|
INSIST(r == 0);
|
||||||
isc_queue_destroy(mgr->workers[i].ievents);
|
isc_queue_destroy(mgr->workers[i].ievents);
|
||||||
|
isc_thread_join(mgr->workers[i].thread, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_condition_destroy(&mgr->wkstatecond);
|
isc_condition_destroy(&mgr->wkstatecond);
|
||||||
@@ -424,9 +425,10 @@ nm_thread(void *worker0) {
|
|||||||
atomic_store(&worker->mgr->paused, false);
|
atomic_store(&worker->mgr->paused, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool finished = worker->finished;
|
||||||
UNLOCK(&worker->lock);
|
UNLOCK(&worker->lock);
|
||||||
|
|
||||||
if (worker->finished) {
|
if (finished) {
|
||||||
/*
|
/*
|
||||||
* We need to launch the loop one more time
|
* We need to launch the loop one more time
|
||||||
* in UV_RUN_NOWAIT mode to make sure that
|
* in UV_RUN_NOWAIT mode to make sure that
|
||||||
|
Reference in New Issue
Block a user