Luna/kernel/src/thread/Scheduler.h
apio a11a5dec1f
All checks were successful
continuous-integration/drone/push Build is passing
DoublyLinkedList -> LinkedList
2022-12-19 12:43:23 +01:00

28 lines
583 B
C++

#pragma once
#include "thread/Thread.h"
namespace Scheduler
{
void init();
Thread* current();
Thread* idle();
Result<void> new_kernel_thread(u64 address);
Result<void> new_kernel_thread(void (*func)(void));
Result<void> new_kernel_thread(void (*func)(void*), void* arg);
Thread* pick_task();
void reap_thread(Thread* thread);
void switch_task(Registers* regs);
void invoke(Registers* regs);
LinkedList<Thread> check_for_dying_threads();
}
extern "C" void kernel_yield();
void kernel_sleep(u64 ms);
[[noreturn]] void kernel_exit();