Skip to content

Commit

Permalink
shared cv: do not wakeup on spurious wakeup with timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Nov 14, 2024
1 parent fdce289 commit c4d55af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions orbis-kernel/src/utils/SharedCV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit c4d55af

Please sign in to comment.