#pragma once
|
|
|
|
#include "gp/indexed_array.hpp"
|
|
#include "gp/vfs/process_data.hpp"
|
|
#include "gp/vfs/runqueue.hpp"
|
|
|
|
namespace gp{
|
|
|
|
class system;
|
|
|
|
struct scheduler {
|
|
topic_list::node_ptr previous;
|
|
topic_list::node_ptr current;
|
|
size_t id;
|
|
system& sys;
|
|
process_data main_context_data;
|
|
topic_list::node main_context;
|
|
|
|
no_inline_decl(
|
|
void yield_to(topic_list::node_ptr target)
|
|
);
|
|
|
|
scheduler(class 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() {
|
|
|
|
}
|
|
};
|
|
|
|
}
|