| 31 | } |
| 32 | |
| 33 | int main(int argc, const char* argv[]) { |
| 34 | concurrencpp::runtime runtime; |
| 35 | auto background_executor = runtime.background_executor(); |
| 36 | auto thread_pool_executor = runtime.thread_pool_executor(); |
| 37 | std::vector<concurrencpp::result<int>> results; |
| 38 | |
| 39 | std::srand(static_cast<unsigned>(std::time(nullptr))); |
| 40 | |
| 41 | for (int i = 0; i < 10; i++) { |
| 42 | const auto sleeping_time_ms = std::rand() % 1000; |
| 43 | results.emplace_back(background_executor->submit(example_job, i, i * 15, sleeping_time_ms)); |
| 44 | } |
| 45 | |
| 46 | consume_all_tasks(thread_pool_executor, std::move(results)).get(); |
| 47 | return 0; |
| 48 | } |
nothing calls this directly
no test coverage detected