Add GBAThreadEnd function for manually shutting down the GBA thread
Jeffrey Pfau jeffrey@endrift.com
Tue, 28 Jan 2014 23:15:30 -0800
2 files changed,
10 insertions(+),
0 deletions(-)
M
src/gba/gba-thread.c
→
src/gba/gba-thread.c
@@ -193,6 +193,15 @@
return 0; } +void GBAThreadEnd(struct GBAThread* threadContext) { + MutexLock(&threadContext->stateMutex); + if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) { + threadContext->debugger->state = DEBUGGER_EXITING; + } + threadContext->state = THREAD_EXITING; + MutexUnlock(&threadContext->stateMutex); +} + void GBAThreadJoin(struct GBAThread* threadContext) { MutexLock(&threadContext->sync.videoFrameMutex); threadContext->sync.videoFrameWait = 0;
M
src/gba/gba-thread.h
→
src/gba/gba-thread.h
@@ -64,6 +64,7 @@ int rewindBufferWriteOffset;
}; int GBAThreadStart(struct GBAThread* threadContext); +void GBAThreadEnd(struct GBAThread* threadContext); void GBAThreadJoin(struct GBAThread* threadContext); void GBAThreadPause(struct GBAThread* threadContext);