(VITA) libco: Fix small bug

This commit is contained in:
frangarcj 2016-09-06 09:26:25 +02:00
parent 5ff25ca6ae
commit 5be5ce8416

View File

@ -37,7 +37,7 @@ void co_thunk(uint32_t argOnInitialize, uint32_t argOnRun)
cothread_t co_active(void)
{
if(!co_active_)
{
{
sceSysmoduleLoadModule(SCE_SYSMODULE_FIBER);
co_active_ = (cothread_t)1;
}
@ -53,7 +53,7 @@ cothread_t co_create(unsigned int heapsize, void (*coentry)(void))
sceSysmoduleLoadModule(SCE_SYSMODULE_FIBER);
co_active_ = (cothread_t)1;
}
//_sceFiberInitializeImpl
int ret = _sceFiberInitializeImpl(tailFiber, "tailFiber", co_thunk, (uint32_t)coentry, (void*) m_contextBuffer, 10000, NULL);
if(ret==0){
@ -71,7 +71,7 @@ void co_delete(cothread_t cothread)
void co_switch(cothread_t cothread)
{
uint32_t argOnReturn = 0;
if(cothread == (cothread_t)1){
co_active_ = cothread;
@ -79,11 +79,12 @@ void co_switch(cothread_t cothread)
}else{
SceFiber* theFiber = (SceFiber*)cothread;
if(co_active_ == (cothread_t)1){
co_active_ = cothread;
sceFiberRun(theFiber, 0, &argOnReturn);
}else{
co_active_ = cothread;
sceFiberSwitch(theFiber, 0, &argOnReturn);
}
co_active_ = cothread;
}
}