Allow threads to gracefully shutdown

This commit is contained in:
Luke Street
2026-04-01 18:30:12 -06:00
parent 7d57ff914b
commit 2e920d510d
16 changed files with 135 additions and 158 deletions
@@ -85,7 +85,15 @@ void* JASTaskThread::run() {
JASThreadCallStack* callstack;
OSInitFastCast();
do {
#ifdef TARGET_PC
BOOL received = FALSE;
callstack = static_cast<JASThreadCallStack*>(waitMessageBlock(&received));
if (!received) {
break;
}
#else
callstack = static_cast<JASThreadCallStack*>(waitMessageBlock());
#endif
if (field_0x84) {
OSSleepThread(&threadQueue_);
}
@@ -98,6 +106,9 @@ void* JASTaskThread::run() {
JASKernel::getCommandHeap()->free(callstack);
} while (true);
#ifdef TARGET_PC
return NULL;
#endif
}
void JASTaskThread::pause(bool param_0) {