wait_for_one should wait for task to finish (#2047)

This commit is contained in:
Cheng 2025-04-06 12:05:16 +09:00 committed by GitHub
parent 7b3b8fa000
commit 6cf48872b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,7 +129,7 @@ class Scheduler {
int n_tasks_old = n_active_tasks();
if (n_tasks_old > 1) {
completion_cv.wait(lk, [this, n_tasks_old] {
return this->n_active_tasks() != n_tasks_old;
return this->n_active_tasks() < n_tasks_old;
});
}
}