mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Kernel: Disable interrupts in Thread::set_state().
We don't want to get interrupted while we're manipulating the thread lists.
This commit is contained in:
parent
802d4dcb6b
commit
e7ce4514ec
Notes:
sideshowbarker
2024-07-19 13:26:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e7ce4514ec6
1 changed files with 2 additions and 0 deletions
|
@ -568,6 +568,7 @@ bool Thread::is_thread(void* ptr)
|
|||
|
||||
void Thread::set_thread_list(InlineLinkedList<Thread>* thread_list)
|
||||
{
|
||||
ASSERT_INTERRUPTS_DISABLED();
|
||||
ASSERT(pid() != 0);
|
||||
if (m_thread_list == thread_list)
|
||||
return;
|
||||
|
@ -580,6 +581,7 @@ void Thread::set_thread_list(InlineLinkedList<Thread>* thread_list)
|
|||
|
||||
void Thread::set_state(State new_state)
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
m_state = new_state;
|
||||
if (m_process.pid() != 0)
|
||||
set_thread_list(thread_list_for_state(new_state));
|
||||
|
|
Loading…
Reference in a new issue