mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Kernel: Implement software context switching and Processor structure
Moving certain globals into a new Processor structure for each CPU allows us to eventually run an instance of the scheduler on each CPU.
This commit is contained in:
parent
10407061d2
commit
fb41d89384
22 changed files with 1002 additions and 513 deletions
|
@ -52,7 +52,7 @@ void WaitQueue::wake_one(Atomic<bool>* lock)
|
|||
return;
|
||||
if (auto* thread = m_threads.take_first())
|
||||
thread->wake_from_queue();
|
||||
Scheduler::stop_idling();
|
||||
Scheduler::yield();
|
||||
}
|
||||
|
||||
void WaitQueue::wake_n(i32 wake_count)
|
||||
|
@ -67,7 +67,7 @@ void WaitQueue::wake_n(i32 wake_count)
|
|||
break;
|
||||
thread->wake_from_queue();
|
||||
}
|
||||
Scheduler::stop_idling();
|
||||
Scheduler::yield();
|
||||
}
|
||||
|
||||
void WaitQueue::wake_all()
|
||||
|
@ -77,7 +77,7 @@ void WaitQueue::wake_all()
|
|||
return;
|
||||
while (!m_threads.is_empty())
|
||||
m_threads.take_first()->wake_from_queue();
|
||||
Scheduler::stop_idling();
|
||||
Scheduler::yield();
|
||||
}
|
||||
|
||||
void WaitQueue::clear()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue