Audit our use of condition variables, fix some minor issues

This commit is contained in:
Henrik Rydgård
2024-01-29 11:09:08 +01:00
parent a93b55c215
commit ee62ffdb02
4 changed files with 32 additions and 27 deletions
+1 -1
View File
@@ -59,8 +59,8 @@ ThreadManager::~ThreadManager() {
void ThreadManager::Teardown() {
for (TaskThreadContext *&threadCtx : global_->threads_) {
threadCtx->cancelled = true;
std::unique_lock<std::mutex> lock(threadCtx->mutex);
threadCtx->cancelled = true;
threadCtx->cond.notify_one();
}