General Purpose library for Freestanding C++ and POSIX systems
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

39 рядки
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. }