forked from ShuriZma/suyu
1
0
Fork 0

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.
This commit is contained in:
Subv 2017-01-01 19:07:37 -05:00
parent f20d872643
commit 4251eb26ec
1 changed files with 2 additions and 1 deletions

View File

@ -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;
} }