Skip to content
Snippets Groups Projects
Commit 4251eb26 authored by Subv's avatar Subv
Browse files

Kernel/Semaphore: Fixed a regression in semaphore waits.

The regression was caused by a missing check in #2260.

The new behavior is consistent with the real kernel.
parent f20d8726
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,8 @@ bool Semaphore::ShouldWait(Thread* thread) const { ...@@ -35,7 +35,8 @@ bool Semaphore::ShouldWait(Thread* thread) const {
} }
void Semaphore::Acquire(Thread* thread) { void Semaphore::Acquire(Thread* thread) {
ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); if (available_count <= 0)
return;
--available_count; --available_count;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment