[XThread] Fixed issue with incorrect thread state caused by invalid suspend count

This commit is contained in:
Gliniak
2025-07-29 08:19:10 +02:00
committed by Radosław Gliński
parent 2969a04145
commit e7e3cfc7fb

View File

@@ -743,6 +743,13 @@ X_STATUS XThread::Suspend(uint32_t* out_suspend_count) {
}
// If we are suspending ourselves, we can't hold the lock.
uint32_t unused_host_suspend_count = 0;
// If we had suspend count wrap around and go back to 0 then thread is not
// suspended.
if (guest_thread->suspend_count == 0) {
return X_STATUS_SUCCESS;
}
if (thread_->Suspend(&unused_host_suspend_count)) {
return X_STATUS_SUCCESS;
} else {