mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix minor scheduling issues in the vpl test.
This commit is contained in:
parent
478d007f96
commit
281685fd43
1 changed files with 12 additions and 0 deletions
|
@ -1358,6 +1358,9 @@ int sceKernelAllocateVpl(SceUID uid, u32 size, u32 addrPtr, u32 timeoutPtr)
|
||||||
VPL *vpl = kernelObjects.Get<VPL>(uid, ignore);
|
VPL *vpl = kernelObjects.Get<VPL>(uid, ignore);
|
||||||
if (error == SCE_KERNEL_ERROR_NO_MEMORY)
|
if (error == SCE_KERNEL_ERROR_NO_MEMORY)
|
||||||
{
|
{
|
||||||
|
if (timeoutPtr != 0 && Memory::Read_U32(timeoutPtr) == 0)
|
||||||
|
return SCE_KERNEL_ERROR_WAIT_TIMEOUT;
|
||||||
|
|
||||||
if (vpl)
|
if (vpl)
|
||||||
{
|
{
|
||||||
SceUID threadID = __KernelGetCurThread();
|
SceUID threadID = __KernelGetCurThread();
|
||||||
|
@ -1369,6 +1372,9 @@ int sceKernelAllocateVpl(SceUID uid, u32 size, u32 addrPtr, u32 timeoutPtr)
|
||||||
__KernelSetVplTimeout(timeoutPtr);
|
__KernelSetVplTimeout(timeoutPtr);
|
||||||
__KernelWaitCurThread(WAITTYPE_VPL, uid, size, timeoutPtr, false, "vpl waited");
|
__KernelWaitCurThread(WAITTYPE_VPL, uid, size, timeoutPtr, false, "vpl waited");
|
||||||
}
|
}
|
||||||
|
// If anyone else was waiting, the allocation causes a delay.
|
||||||
|
else if (error == 0 && !vpl->waitingThreads.empty())
|
||||||
|
return hleDelayResult(error, "vpl allocated", 50);
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -1383,6 +1389,9 @@ int sceKernelAllocateVplCB(SceUID uid, u32 size, u32 addrPtr, u32 timeoutPtr)
|
||||||
VPL *vpl = kernelObjects.Get<VPL>(uid, ignore);
|
VPL *vpl = kernelObjects.Get<VPL>(uid, ignore);
|
||||||
if (error == SCE_KERNEL_ERROR_NO_MEMORY)
|
if (error == SCE_KERNEL_ERROR_NO_MEMORY)
|
||||||
{
|
{
|
||||||
|
if (timeoutPtr != 0 && Memory::Read_U32(timeoutPtr) == 0)
|
||||||
|
return SCE_KERNEL_ERROR_WAIT_TIMEOUT;
|
||||||
|
|
||||||
if (vpl)
|
if (vpl)
|
||||||
{
|
{
|
||||||
SceUID threadID = __KernelGetCurThread();
|
SceUID threadID = __KernelGetCurThread();
|
||||||
|
@ -1394,6 +1403,9 @@ int sceKernelAllocateVplCB(SceUID uid, u32 size, u32 addrPtr, u32 timeoutPtr)
|
||||||
__KernelSetVplTimeout(timeoutPtr);
|
__KernelSetVplTimeout(timeoutPtr);
|
||||||
__KernelWaitCurThread(WAITTYPE_VPL, uid, size, timeoutPtr, true, "vpl waited");
|
__KernelWaitCurThread(WAITTYPE_VPL, uid, size, timeoutPtr, true, "vpl waited");
|
||||||
}
|
}
|
||||||
|
// If anyone else was waiting, the allocation causes a delay.
|
||||||
|
else if (error == 0 && !vpl->waitingThreads.empty())
|
||||||
|
return hleDelayResult(error, "vpl allocated", 50);
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue