Luna/kernel/src/thread/Scheduler.h

34 lines
711 B
C++

#pragma once
#include "fs/VFS.h"
#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);
Result<void> new_userspace_thread(SharedPtr<VFS::Inode> inode);
void add_thread(Thread* thread);
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();