mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-09-26 02:56:24 -05:00
coreinit: Make sure thread deallocation runs before join returns
Fixes crash in Coaster Crazy Deluxe
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user