all repos — mgba @ 07c2c87d000a0db0185800b4a8965e6b1d57be35

mGBA Game Boy Advance Emulator

3DS: Fix thread cleanup
Vicki Pfau vi@endrift.com
Mon, 24 Aug 2020 18:24:22 -0700
commit

07c2c87d000a0db0185800b4a8965e6b1d57be35

parent

98f2d14b81b89bcc287ccf47722bfbd2fa917b27

3 files changed, 5 insertions(+), 6 deletions(-)

jump to
M CHANGESCHANGES

@@ -44,6 +44,7 @@ - SM83: Emulate HALT bug

Other fixes: - 3DS: Redo video sync to be more precise - 3DS: Fix crash with libctru 2.0 when exiting + - 3DS: Fix thread cleanup - All: Improve export headers (fixes mgba.io/i/1738) - Core: Ensure ELF regions can be written before trying - Core: Fix reported ROM size when a fixed buffer size is used
M include/mgba-util/platform/3ds/threading.hinclude/mgba-util/platform/3ds/threading.h

@@ -69,12 +69,14 @@ static inline int ThreadCreate(Thread* thread, ThreadEntry entry, void* context) {

if (!entry || !thread) { return 1; } - *thread = threadCreate(entry, context, 0x8000, 0x18, 2, true); + *thread = threadCreate(entry, context, 0x8000, 0x18, 2, false); return !*thread; } static inline int ThreadJoin(Thread* thread) { - return threadJoin(*thread, U64_MAX); + Result res = threadJoin(*thread, U64_MAX); + threadFree(*thread); + return res; } static inline void ThreadSetName(const char* name) {
M src/feature/thread-proxy.csrc/feature/thread-proxy.c

@@ -206,10 +206,6 @@ proxyRenderer->threadState = PROXY_THREAD_IDLE;

} } MutexUnlock(&proxyRenderer->mutex); - -#ifdef _3DS - svcExitThread(); -#endif return 0; }