This commit is contained in:
Xiao Wan 2024-08-13 22:22:10 +05:00 committed by GitHub
commit cba430caff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 2 deletions

View File

@ -575,8 +575,16 @@ txg_sync_thread(void *arg)
txg_thread_wait(tx, &cpr, &tx->tx_quiesce_done_cv, 0);
}
if (tx->tx_exiting)
txg_thread_exit(tx, &cpr, &tx->tx_sync_thread);
/*
* Wait until the quiesce thread has exited to ensure every
* quiesced txg has been synced before exiting.
*/
if (tx->tx_exiting) {
while (tx->tx_threads != 1)
txg_thread_wait(tx, &cpr, &tx->tx_exit_cv, 0);
if (tx->tx_quiesced_txg == 0)
txg_thread_exit(tx, &cpr, &tx->tx_sync_thread);
}
/*
* Consume the quiesced txg which has been handed off to