kernel/user_mutex: Fix unset of locked flag if no entries were notified.

It turns out this code actually is possible to trigger, e.g. using
Git checkouts, where EINTR due to signals happens quite often.
However, even with this commit, it still does not work quite right,
due to an oversight in condition-variable notify accounting. That
will be addressed in the next commit.
This commit is contained in:
Augustin Cavalier
2023-08-04 15:19:41 -04:00
parent 2d43eebcab
commit 798b773393
+1 -1
View File
@@ -406,7 +406,7 @@ user_mutex_unblock(UserMutexEntry* entry, int32* mutex, uint32 flags, bool isWir
entry->condition.NotifyAll(B_OK);
} else {
if (!entry->condition.NotifyOne(B_OK))
user_atomic_or(mutex, ~(int32)B_USER_MUTEX_LOCKED, isWired);
user_atomic_and(mutex, ~(int32)B_USER_MUTEX_LOCKED, isWired);
}
if (entry->condition.EntriesCount() == 0)