mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +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:
@@ -817,7 +817,8 @@ void Thread::set_state(State new_state)
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user