Fix cond_variable timeout

Thanks @Farseer2 for debugging
This commit is contained in:
Nekotekina 2017-11-17 22:20:46 +03:00
parent 223f17ac7e
commit c58738807e
3 changed files with 7 additions and 4 deletions

View file

@ -1768,7 +1768,7 @@ bool thread_ctrl::_wait_for(u64 usec)
}
}
}
while (_this->m_cond.wait(_lock, std::exchange(usec, usec == -1 ? -1 : 0)));
while (_this->m_cond.wait(_lock, std::exchange(usec, usec > cond_variable::max_timeout ? -1 : 0)));
// Timeout
return false;