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.
 
 

44 regels
774 B

#pragma once
#include "gp/containers/indexed_array.hpp"
#include "gp/system/process_data.hpp"
#include "gp/system/task_queue.hpp"
namespace gp {
namespace system {
class system;
struct scheduler {
task_queue::node_ptr previous;
task_queue::node_ptr current;
size_t id;
system& sys;
process_data main_context_data;
task_queue::node main_context;
no_inline_decl(
void yield_to(task_queue::node_ptr target)
);
scheduler(system&, size_t token);
scheduler(scheduler&& v)
: previous(v.previous)
, current(v.current)
, id(v.id)
, sys(v.sys)
, main_context_data(gp::move(v.main_context_data))
, main_context(gp::move(v.main_context))
{}
void run();
void yield();
~scheduler() {
}
};
}
}