Kernel: Initial implementation of thread preemption.
This commit is contained in:
parent
103f3a2fe5
commit
b49c0dab87
3 changed files with 30 additions and 0 deletions
|
@ -133,6 +133,8 @@ public:
|
|||
*/
|
||||
bool YieldThreadAndWaitForLoadBalancing(Thread* thread);
|
||||
|
||||
void PreemptThreads();
|
||||
|
||||
u32 CpuCoresCount() const {
|
||||
return NUM_CPU_CORES;
|
||||
}
|
||||
|
@ -153,6 +155,8 @@ private:
|
|||
std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> suggested_queue;
|
||||
std::atomic<bool> reselection_pending;
|
||||
|
||||
std::array<u64, NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 62};
|
||||
|
||||
/// Lists all thread ids that aren't deleted/etc.
|
||||
std::vector<SharedPtr<Thread>> thread_list;
|
||||
Core::System& system;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue