General Purpose library for Freestanding C++ and POSIX systems
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

39 linhas
494 B

  1. #pragma once
  2. #include "gp/indexed_array.hpp"
  3. #include "gp/vfs/process_data.hpp"
  4. namespace gp{
  5. class system;
  6. class scheduler {
  7. gp::specifics::platform_data root;
  8. size_t current = 0;
  9. system& sys;
  10. no_inline_decl(
  11. void yield_to(size_t target_pid)
  12. );
  13. public:
  14. scheduler(class system&);
  15. [[noreturn]] void run(allocator& alloc) {
  16. again:
  17. run_once();
  18. cleanup(alloc);
  19. goto again;
  20. }
  21. void cleanup(allocator& alloc);
  22. void run_once();
  23. void yield(){
  24. yield_to(0);
  25. }
  26. };
  27. }