mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 01:41:17 +08:00
wait_for_one should wait for task to finish (#2047)
This commit is contained in:
parent
7b3b8fa000
commit
6cf48872b7
@ -129,7 +129,7 @@ class Scheduler {
|
|||||||
int n_tasks_old = n_active_tasks();
|
int n_tasks_old = n_active_tasks();
|
||||||
if (n_tasks_old > 1) {
|
if (n_tasks_old > 1) {
|
||||||
completion_cv.wait(lk, [this, n_tasks_old] {
|
completion_cv.wait(lk, [this, n_tasks_old] {
|
||||||
return this->n_active_tasks() != n_tasks_old;
|
return this->n_active_tasks() < n_tasks_old;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user