General Purpose library for Freestanding C++ and POSIX systems
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

44 行
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() {
}
};
}
}