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:
parent
dfce9051fa
commit
97b3035c14
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue