General Purpose library for Freestanding C++ and POSIX systems
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 rivejä
494 B

#pragma once
#include "gp/indexed_array.hpp"
#include "gp/vfs/process_data.hpp"
namespace gp{
class system;
class scheduler {
gp::specifics::platform_data root;
size_t current = 0;
system& sys;
no_inline_decl(
void yield_to(size_t target_pid)
);
public:
scheduler(class system&);
[[noreturn]] void run(allocator& alloc) {
again:
run_once();
cleanup(alloc);
goto again;
}
void cleanup(allocator& alloc);
void run_once();
void yield(){
yield_to(0);
}
};
}