Skip to content
Snippets Groups Projects
Commit cbec141a authored by Avi Kivity's avatar Avi Kivity
Browse files

sched: fix reaper unlock-without-lock-held

wait_until(mutex, ...) must be called with the mutex held.
parent 0ed663a8
No related branches found
No related tags found
No related merge requests found
...@@ -468,8 +468,8 @@ detached_thread::reaper::reaper() ...@@ -468,8 +468,8 @@ detached_thread::reaper::reaper()
void detached_thread::reaper::reap() void detached_thread::reaper::reap()
{ {
while (true) { while (true) {
wait_until(_mtx, [=] { return !_zombies.empty(); });
with_lock(_mtx, [=] { with_lock(_mtx, [=] {
wait_until(_mtx, [=] { return !_zombies.empty(); });
while (!_zombies.empty()) { while (!_zombies.empty()) {
auto z = _zombies.front(); auto z = _zombies.front();
_zombies.pop_front(); _zombies.pop_front();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment