Skip to content

Commit 41123e7

Browse files
committed
Core: Fix crashed checks when state is pending request
1 parent 9ce8187 commit 41123e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/thread.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ bool mCoreThreadHasCrashed(struct mCoreThread* threadContext) {
490490
}
491491
bool hasExited;
492492
MutexLock(&threadContext->impl->stateMutex);
493-
hasExited = threadContext->impl->state == mTHREAD_CRASHED;
493+
hasExited = !!(threadContext->impl->requested & mTHREAD_REQ_CRASHED);
494494
MutexUnlock(&threadContext->impl->stateMutex);
495495
return hasExited;
496496
}
@@ -567,7 +567,9 @@ bool mCoreThreadIsActive(struct mCoreThread* threadContext) {
567567
if (!threadContext->impl) {
568568
return false;
569569
}
570-
return threadContext->impl->state >= mTHREAD_RUNNING && threadContext->impl->state < mTHREAD_EXITING && threadContext->impl->state != mTHREAD_CRASHED;
570+
return threadContext->impl->state >= mTHREAD_RUNNING &&
571+
threadContext->impl->state < mTHREAD_EXITING &&
572+
!(threadContext->impl->requested & mTHREAD_REQ_CRASHED);
571573
}
572574

573575
void mCoreThreadInterrupt(struct mCoreThread* threadContext) {

0 commit comments

Comments
 (0)