| 7 | #include "concurrencpp/concurrencpp.h" |
| 8 | |
| 9 | int example_job(int task_num, int dummy_value, int sleeping_time_ms) { |
| 10 | const auto msg0 = |
| 11 | std::string("task num: ") + std::to_string(task_num) + " is going to sleep for " + std::to_string(sleeping_time_ms) + " ms"; |
| 12 | std::cout << msg0 << std::endl; |
| 13 | |
| 14 | std::this_thread::sleep_for(std::chrono::milliseconds(sleeping_time_ms)); |
| 15 | |
| 16 | const auto msg1 = std::string("task num: ") + std::to_string(task_num) + " woke up."; |
| 17 | std::cout << msg1 << std::endl; |
| 18 | |
| 19 | return dummy_value; |
| 20 | } |
| 21 | |
| 22 | concurrencpp::result<void> consume_all_tasks(std::shared_ptr<concurrencpp::thread_pool_executor> resume_executor, |
| 23 | std::vector<concurrencpp::result<int>> results) { |
nothing calls this directly
no test coverage detected