General Purpose library for Freestanding C++ and POSIX systems
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

40 rader
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);
}
};
}