mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
[Kernel] Implement thread sleeping
This commit is contained in:
parent
db0adc55c1
commit
2a4709dcfa
6 changed files with 60 additions and 7 deletions
|
@ -94,5 +94,14 @@ void Kernel::waitSynchronizationN() {
|
|||
|
||||
printf("Hacky WaitSync stuff for OoT triggered!!!\n");
|
||||
threads[currentThreadIndex].status = ThreadStatus::Ready;
|
||||
switchThread(rand() % threadCount);
|
||||
|
||||
while (1) {
|
||||
auto index = rand() % threadCount;
|
||||
auto& thread = threads[index];
|
||||
|
||||
if (canThreadRun(thread)) {
|
||||
switchThread(rand() % threadCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue