1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

Kernel: Don't resume thread into Running state directly on SIGCONT

We should never resume a thread by directly setting it to Running state.
Instead, if a thread was in Running state when stopped, record the state
as Runnable.

Fixes #4150
This commit is contained in:
Tom 2020-11-23 10:09:56 -07:00 committed by Andreas Kling
parent dfce9051fa
commit 97b3035c14

View file

@ -817,7 +817,8 @@ void Thread::set_state(State new_state)
} }
if (new_state == Stopped) { if (new_state == Stopped) {
m_stop_state = m_state; // We don't want to restore to Running state, only Runnable!
m_stop_state = m_state != Running ? m_state : Runnable;
} }
m_state = new_state; m_state = new_state;