General Purpose library for Freestanding C++ and POSIX systems
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

39 rindas
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. }