27 lines
537 B
C++
27 lines
537 B
C++
#pragma once
|
|
|
|
#include "scheduler/process.h"
|
|
#include "scheduler/thread.h"
|
|
|
|
namespace sched {
|
|
|
|
// Create the scheduler object in a disabled state,
|
|
// processes can be added but will not be scheduled.
|
|
void InitScheduler();
|
|
|
|
// Enables the scheduler such that processes will yield on ticks.
|
|
void EnableScheduler();
|
|
|
|
void Yield();
|
|
|
|
// Scheduler will take ownership
|
|
// of the created process.
|
|
void InsertProcess(Process* proc);
|
|
|
|
void EnqueueThread(Thread* thread);
|
|
|
|
Process& CurrentProcess();
|
|
Thread& CurrentThread();
|
|
|
|
} // namespace sched
|