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.

42 rader
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. }