mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
coreinit: Fix potential race condition in IPC code
This commit is contained in:
parent
9ec50b865d
commit
9bb409314d
@ -578,8 +578,12 @@ namespace iosu
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::mutex sMtxReply[3];
|
||||||
|
|
||||||
void _IPCReplyAndRelease(IOSDispatchableCommand* dispatchCmd, uint32 result)
|
void _IPCReplyAndRelease(IOSDispatchableCommand* dispatchCmd, uint32 result)
|
||||||
{
|
{
|
||||||
|
cemu_assert(dispatchCmd->ppcCoreIndex < 3);
|
||||||
|
std::unique_lock _l(sMtxReply[(uint32)dispatchCmd->ppcCoreIndex]);
|
||||||
cemu_assert(dispatchCmd >= sIPCDispatchableCommandPool.GetPtr() && dispatchCmd < sIPCDispatchableCommandPool.GetPtr() + sIPCDispatchableCommandPool.GetCount());
|
cemu_assert(dispatchCmd >= sIPCDispatchableCommandPool.GetPtr() && dispatchCmd < sIPCDispatchableCommandPool.GetPtr() + sIPCDispatchableCommandPool.GetCount());
|
||||||
dispatchCmd->originalBody->result = result;
|
dispatchCmd->originalBody->result = result;
|
||||||
// submit to COS
|
// submit to COS
|
||||||
|
Loading…
Reference in New Issue
Block a user