mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-06-16 10:37:56 -05:00
Kernel: Refactor synchronization to better match RE
This commit is contained in:
committed by
FernandoS27
parent
c5aefe42aa
commit
d23d504d77
@ -31,6 +31,10 @@ bool Thread::ShouldWait(const Thread* thread) const {
|
||||
return status != ThreadStatus::Dead;
|
||||
}
|
||||
|
||||
bool Thread::IsSignaled() const {
|
||||
return status == ThreadStatus::Dead;
|
||||
}
|
||||
|
||||
void Thread::Acquire(Thread* thread) {
|
||||
ASSERT_MSG(!ShouldWait(thread), "object unavailable!");
|
||||
}
|
||||
@ -45,7 +49,7 @@ void Thread::Stop() {
|
||||
kernel.ThreadWakeupCallbackHandleTable().Close(callback_handle);
|
||||
callback_handle = 0;
|
||||
SetStatus(ThreadStatus::Dead);
|
||||
WakeupAllWaitingThreads();
|
||||
Signal();
|
||||
|
||||
// Clean up any dangling references in objects that this thread was waiting for
|
||||
for (auto& wait_object : wait_objects) {
|
||||
|
Reference in New Issue
Block a user