Improve perf of sceKernelCheckCallback().

Some games seem to call this a lot.
This commit is contained in:
Unknown W. Brackets 2013-03-09 14:11:53 -08:00
parent b77d965e56
commit f9fc1af5c8

View file

@ -2696,6 +2696,14 @@ bool __KernelCheckCallbacks() {
bool __KernelForceCallbacks()
{
// Let's not check every thread all the time, callbacks are fairly uncommon.
if (readyCallbacksCount == 0) {
return false;
}
if (readyCallbacksCount < 0) {
ERROR_LOG(HLE, "readyCallbacksCount became negative: %i", readyCallbacksCount);
}
Thread *curThread = __GetCurrentThread();
bool callbacksProcessed = __KernelCheckThreadCallbacks(curThread, true);