Always create CoreTiming timers during kernel init.

This commit is contained in:
Unknown W. Brackets 2012-12-23 21:27:26 -08:00
parent 65cfc8de86
commit 9ba0ed46fd
13 changed files with 38 additions and 56 deletions

View file

@ -61,13 +61,11 @@ struct Semaphore : public KernelObject
std::vector<SceUID> waitingThreads;
};
bool semaInitComplete = false;
int semaWaitTimer = 0;
static int semaWaitTimer = 0;
void __KernelSemaInit()
{
semaWaitTimer = CoreTiming::RegisterEvent("SemaphoreTimeout", &__KernelSemaTimeout);
semaInitComplete = true;
}
// Returns whether the thread should be removed.
@ -173,9 +171,6 @@ int sceKernelCancelSema(SceUID id, int newCount, u32 numWaitThreadsPtr)
//SceUID sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);
int sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32 optionPtr)
{
if (!semaInitComplete)
__KernelSemaInit();
if (!name)
{
WARN_LOG(HLE, "%08x=sceKernelCreateSema(): invalid name", SCE_KERNEL_ERROR_ERROR);