kernel/condition_variable: Add another check of the wait status after _RemoveFromVariable.

If it was set, we want to return it.
This commit is contained in:
Augustin Cavalier 2024-01-30 14:22:54 -05:00
parent a162e7af99
commit 6a47944773

View File

@ -176,6 +176,9 @@ ConditionVariableEntry::Wait(uint32 flags, bigtime_t timeout)
if ((flags & B_RELATIVE_TIMEOUT) != 0 && timeout <= 0) {
_RemoveFromVariable();
if (fWaitStatus <= 0)
return fWaitStatus;
return B_WOULD_BLOCK;
}