mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Resume waiting threads when Mbx is destroyed
This commit is contained in:
parent
35c7b411aa
commit
c6ec09cf86
1 changed files with 22 additions and 8 deletions
|
@ -85,8 +85,22 @@ SceUID sceKernelCreateMbx(const char *name, int memoryPartition, SceUInt attr, i
|
|||
}
|
||||
|
||||
int sceKernelDeleteMbx(SceUID id)
|
||||
{
|
||||
u32 error;
|
||||
Mbx *m = kernelObjects.Get<Mbx>(id, error);
|
||||
if (m)
|
||||
{
|
||||
DEBUG_LOG(HLE, "sceKernelDeleteMbx(%i)", id);
|
||||
for (size_t i = 0; i < m->waitingThreads.size(); i++)
|
||||
{
|
||||
Memory::Write_U32(0, m->waitingThreads[i].second);
|
||||
__KernelResumeThreadFromWait(m->waitingThreads[i].first);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG(HLE, "sceKernelDeleteMbx(%i): invalid mbx id", id);
|
||||
}
|
||||
return kernelObjects.Destroy<Mbx>(id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue