forked from Bananymous/banan-os
Kernel: Replace last CriticalScopes in kernel with SpinLocks
This commit is contained in:
@@ -30,9 +30,12 @@ namespace Kernel
|
||||
static pid_t current_tid();
|
||||
|
||||
[[noreturn]] void execute_current_thread();
|
||||
[[noreturn]] void _execute_current_thread();
|
||||
[[noreturn]] void execute_current_thread_locked();
|
||||
[[noreturn]] void delete_current_process_and_thread();
|
||||
|
||||
// This is no return if called on current thread
|
||||
void terminate_thread(Thread*);
|
||||
|
||||
private:
|
||||
Scheduler() = default;
|
||||
|
||||
@@ -43,6 +46,8 @@ namespace Kernel
|
||||
void remove_and_advance_current_thread();
|
||||
void advance_current_thread();
|
||||
|
||||
[[noreturn]] void execute_current_thread_stack_loaded();
|
||||
|
||||
BAN::ErrorOr<void> add_thread(Thread*);
|
||||
|
||||
private:
|
||||
@@ -57,6 +62,8 @@ namespace Kernel
|
||||
Semaphore* semaphore;
|
||||
};
|
||||
|
||||
SpinLockUnsafe m_lock;
|
||||
|
||||
Thread* m_idle_thread { nullptr };
|
||||
BAN::LinkedList<SchedulerThread> m_active_threads;
|
||||
BAN::LinkedList<SchedulerThread> m_sleeping_threads;
|
||||
|
||||
Reference in New Issue
Block a user