General Purpose library for Freestanding C++ and POSIX systems
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
682 B

  1. #pragma once
  2. #include "gp/indexed_array.hpp"
  3. #include "gp/vfs/process_data.hpp"
  4. #include "gp/vfs/runqueue.hpp"
  5. namespace gp{
  6. class system;
  7. struct scheduler {
  8. topic_list::node_ptr previous;
  9. topic_list::node_ptr current;
  10. size_t id;
  11. system& sys;
  12. process_data main_context_data;
  13. topic_list::node main_context;
  14. no_inline_decl(
  15. void yield_to(topic_list::node_ptr target)
  16. );
  17. scheduler(class system&, size_t token);
  18. scheduler(scheduler&& v)
  19. : previous(v.previous)
  20. , current(v.current)
  21. , id(v.id)
  22. , sys(v.sys)
  23. , main_context_data(gp::move(v.main_context_data))
  24. , main_context(gp::move(v.main_context))
  25. {}
  26. void run();
  27. void yield();
  28. ~scheduler() {
  29. }
  30. };
  31. }