[Kernel] Handle timeout errors properly

This commit is contained in:
wheremyfoodat 2023-04-30 14:41:57 +03:00
parent 5e0c4b76ac
commit 74b06da6b2
2 changed files with 8 additions and 2 deletions

View file

@ -262,10 +262,13 @@ int Kernel::wakeupOneThread(u64 waitlist, Handle handle) {
switch (t.status) {
case ThreadStatus::WaitSync1:
t.status = ThreadStatus::Ready;
t.gprs[0] = SVCResult::Success; // The thread did not timeout, so write success to r0
break;
case ThreadStatus::WaitSyncAny:
t.status = ThreadStatus::Ready;
t.gprs[0] = SVCResult::Success; // The thread did not timeout, so write success to r0
// Get the index of the event in the object's waitlist, write it to r1
for (size_t i = 0; i < t.waitList.size(); i++) {
if (t.waitList[i] == handle) {