mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-19 17:29:06 +02:00
Initial sceKernelRotateThreadReadyQueue().
Might not be right but it's closer. Makes games that call this func much faster.
This commit is contained in:
1 parent
db3f01044d
commit
411c711dac
3 files changed
+25
-4
No files matched your search
@@ -1600,10 +1600,31 @@ u32 sceKernelResumeDispatchThread(u32 suspended)
|
||||
return oldDispatchSuspended;
|
||||
}
|
||||
|
||||
void sceKernelRotateThreadReadyQueue()
|
||||
int sceKernelRotateThreadReadyQueue(int priority)
|
||||
{
|
||||
DEBUG_LOG(HLE,"sceKernelRotateThreadReadyQueue : rescheduling");
|
||||
hleReSchedule("rotatethreadreadyqueue");
|
||||
|
||||
// TODO: Does it try better-priority threads? Is 0 special?
|
||||
if (!threadReadyQueue[priority].empty())
|
||||
{
|
||||
Thread *cur = __GetCurrentThread();
|
||||
// TODO: Who gets switched to with currentThread-priority? Next or next-next?
|
||||
if (cur->nt.currentPriority == priority)
|
||||
__KernelChangeReadyState(currentThread, true);
|
||||
|
||||
size_t readySize = threadReadyQueue[priority].size();
|
||||
if (readySize > 1)
|
||||
{
|
||||
SceUID first = threadReadyQueue[priority][0];
|
||||
memmove(&threadReadyQueue[priority][0], &threadReadyQueue[priority][1], (readySize - 1) * sizeof(SceUID));
|
||||
threadReadyQueue[priority][readySize - 1] = first;
|
||||
}
|
||||
hleReSchedule("rotatethreadreadyqueue");
|
||||
}
|
||||
// TODO: Does it reschedule in other cases?
|
||||
|
||||
// TODO: Any way to get a different return?
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceKernelDeleteThread(int threadHandle)
|
||||
|
||||
Reference in new issue
Block a user