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

pthread: don't take mutex in cond_var's wait_until()

A mutex will also call wait_until, which doesn't tolerate nesting.
parent 934839fe
No related branches found
No related tags found
No related merge requests found
......@@ -208,8 +208,7 @@ int cond_var::wait(mutex* user_mutex, sched::timer* tmr)
});
user_mutex->unlock();
sched::thread::wait_until([&] {
return (tmr && tmr->expired())
|| with_lock(_mutex, [&] { return !wr.t; });
return (tmr && tmr->expired()) || !wr.t;
});
if (tmr && tmr->expired()) {
with_lock(_mutex, [&] {
......
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