[orbis-kernel] shared_cv fixup

This commit is contained in:
Ivan Chikish 2023-07-07 14:16:35 +03:00
parent 3d78443496
commit cab89f44a5

View file

@ -82,8 +82,8 @@ void shared_cv::impl_wake(shared_mutex &mutex, int _count) noexcept {
if (_count) {
// Wake up one thread + requeue remaining waiters
if (auto r = syscall(SYS_futex, &m_value, FUTEX_CMP_REQUEUE, +locked,
&mutex, _count - +locked, _old);
if (auto r = syscall(SYS_futex, &m_value, FUTEX_REQUEUE, +locked,
&mutex, _count - +locked, 0);
r < _count) {
// Keep awaking waiters
return impl_wake(mutex, is_one ? 1 : INT_MAX);