From c4d55af26a9ed1affc9ba8abe61f8a7c081a75a2 Mon Sep 17 00:00:00 2001 From: DH Date: Thu, 14 Nov 2024 17:28:10 +0300 Subject: [PATCH] shared cv: do not wakeup on spurious wakeup with timeout --- orbis-kernel/src/utils/SharedCV.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orbis-kernel/src/utils/SharedCV.cpp b/orbis-kernel/src/utils/SharedCV.cpp index 0749e66..c3c53a6 100644 --- a/orbis-kernel/src/utils/SharedCV.cpp +++ b/orbis-kernel/src/utils/SharedCV.cpp @@ -31,7 +31,7 @@ std::errc shared_cv::impl_wait(shared_mutex &mutex, unsigned _val, // Remove waiter if no signals if ((value & ~c_waiter_mask) == 0) { - if (useTimeout || !spurious) { + if (!spurious) { value -= 1; } } @@ -66,7 +66,7 @@ std::errc shared_cv::impl_wait(shared_mutex &mutex, unsigned _val, #endif // Possibly spurious wakeup - if (useTimeout || !spurious) { + if (!spurious) { break; }