mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-14 00:59:55 -05:00
Kernel: Object ShouldWait and Acquire calls now take a thread as a parameter.
This will be useful when implementing mutex priority inheritance.
This commit is contained in:
@ -30,12 +30,12 @@ ResultVal<SharedPtr<Semaphore>> Semaphore::Create(s32 initial_count, s32 max_cou
|
||||
return MakeResult<SharedPtr<Semaphore>>(std::move(semaphore));
|
||||
}
|
||||
|
||||
bool Semaphore::ShouldWait() {
|
||||
bool Semaphore::ShouldWait(Thread* thread) const {
|
||||
return available_count <= 0;
|
||||
}
|
||||
|
||||
void Semaphore::Acquire() {
|
||||
ASSERT_MSG(!ShouldWait(), "object unavailable!");
|
||||
void Semaphore::Acquire(Thread* thread) {
|
||||
ASSERT_MSG(!ShouldWait(thread), "object unavailable!");
|
||||
--available_count;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user