| 41 | } |
| 42 | |
| 43 | static std::string simulate_nested_scheduling(auto worker, const auto& obs, std::vector<std::string>& out) |
| 44 | { |
| 45 | std::thread thread([&, worker] { |
| 46 | worker.schedule([&, worker](const auto&) { |
| 47 | out.push_back("Task 1 starts "s + get_thread_id_as_string()); |
| 48 | |
| 49 | worker.schedule([&, worker](const auto&) { |
| 50 | out.push_back("Task 2 starts "s + get_thread_id_as_string()); |
| 51 | |
| 52 | worker.schedule([&](const auto&) { |
| 53 | out.push_back("Task 3 runs "s + get_thread_id_as_string()); |
| 54 | return rpp::schedulers::optional_delay_from_now{}; |
| 55 | }, |
| 56 | obs); |
| 57 | |
| 58 | out.push_back("Task 2 ends "s + get_thread_id_as_string()); |
| 59 | return rpp::schedulers::optional_delay_from_now{}; |
| 60 | }, |
| 61 | obs); |
| 62 | |
| 63 | out.push_back("Task 1 ends "s + get_thread_id_as_string()); |
| 64 | return rpp::schedulers::optional_delay_from_now{}; |
| 65 | }, |
| 66 | obs); |
| 67 | }); |
| 68 | |
| 69 | auto threadid = get_thread_id_as_string(thread.get_id()); |
| 70 | thread.join(); |
| 71 | return threadid; |
| 72 | } |
| 73 | |
| 74 | static std::string simulate_complex_scheduling(const auto& worker, const auto& obs, std::vector<std::string>& out) |
| 75 | { |
no test coverage detected