mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Merge branch '1494-lock-order-inversion-potential-deadlock-nm_thread-vs-nm_destroy' into 'master'
Resolve "lock-order-inversion (potential deadlock) - nm_thread vs nm_destroy" Closes #1494 See merge request isc-projects/bind9!2763
This commit is contained in:
@@ -168,7 +168,6 @@ nm_destroy(isc_nm_t **mgr0) {
|
||||
|
||||
isc_refcount_destroy(&mgr->references);
|
||||
|
||||
LOCK(&mgr->lock);
|
||||
mgr->magic = 0;
|
||||
|
||||
for (size_t i = 0; i < mgr->nworkers; i++) {
|
||||
@@ -181,6 +180,7 @@ nm_destroy(isc_nm_t **mgr0) {
|
||||
isc__nm_enqueue_ievent(&mgr->workers[i], event);
|
||||
}
|
||||
|
||||
LOCK(&mgr->lock);
|
||||
while (atomic_load(&mgr->workers_running) > 0) {
|
||||
WAIT(&mgr->wkstatecond, &mgr->lock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user