mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-02 13:01:18 +12:00
coreinit: Make sure thread deallocation runs before join returns
Fixes crash in Coaster Crazy Deluxe
This commit is contained in:
parent
4f4c9594ac
commit
e91740cf29
1 changed files with 4 additions and 1 deletions
|
@ -717,7 +717,10 @@ namespace coreinit
|
|||
thread->id = 0x8000;
|
||||
|
||||
if (!thread->deallocatorFunc.IsNull())
|
||||
{
|
||||
__OSQueueThreadDeallocation(thread);
|
||||
PPCCore_switchToSchedulerWithLock(); // make sure the deallocation function runs before we return
|
||||
}
|
||||
|
||||
__OSUnlockScheduler();
|
||||
|
||||
|
@ -1525,7 +1528,7 @@ namespace coreinit
|
|||
}
|
||||
|
||||
// queue thread deallocation to run after current thread finishes
|
||||
// the termination threads run at a higher priority on the same threads
|
||||
// the termination threads run at a higher priority on the same core
|
||||
void __OSQueueThreadDeallocation(OSThread_t* thread)
|
||||
{
|
||||
uint32 coreIndex = OSGetCoreId();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue