1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00
serenity/Kernel/Scheduler.h
Andreas Kling 8cc6e304ca Kernel: Clean up around Scheduler::yield() a bit.
Also add assertion in Lock that the scheduler isn't currently active.
I've been seeing occasional fuckups that I suspect might be someone called
by the scheduler trying to take a busy lock.
2019-02-06 15:06:48 +01:00

25 lines
582 B
C++

#pragma once
#include <AK/Assertions.h>
class Process;
struct RegisterDump;
extern Process* current;
extern Process* g_last_fpu_process;
class Scheduler {
public:
static void initialize();
static void timer_tick(RegisterDump&);
static bool pick_next();
static void pick_next_and_switch_now();
static void switch_now();
static bool yield();
static bool context_switch(Process&);
static void prepare_to_modify_tss(Process&);
static Process* colonel();
static bool is_active();
private:
static void prepare_for_iret_to_new_process();
};