diff --git a/src/gba/gba-thread.c b/src/gba/gba-thread.c index 318415ec1..22bb502cc 100644 --- a/src/gba/gba-thread.c +++ b/src/gba/gba-thread.c @@ -185,6 +185,14 @@ int GBAThreadStart(struct GBAThread* threadContext) { return 0; } +int GBAThreadHasStarted(struct GBAThread* threadContext) { + int hasStarted; + MutexLock(&threadContext->stateMutex); + hasStarted = threadContext->state > THREAD_INITIALIZED; + MutexUnlock(&threadContext->stateMutex); + return hasStarted; +} + void GBAThreadEnd(struct GBAThread* threadContext) { MutexLock(&threadContext->stateMutex); if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) { diff --git a/src/gba/gba-thread.h b/src/gba/gba-thread.h index 33098b681..582d4990f 100644 --- a/src/gba/gba-thread.h +++ b/src/gba/gba-thread.h @@ -66,6 +66,7 @@ struct GBAThread { }; int GBAThreadStart(struct GBAThread* threadContext); +int GBAThreadHasStarted(struct GBAThread* threadContext); void GBAThreadEnd(struct GBAThread* threadContext); void GBAThreadJoin(struct GBAThread* threadContext);