| 25 | #include "openhd_util_async.h" |
| 26 | |
| 27 | int main(int argc, char *argv[]) { |
| 28 | openhd::AsyncHandle::instance(); |
| 29 | openhd::AsyncHandle::instance().execute_async("LONG_TASK", []() { |
| 30 | std::this_thread::sleep_for(std::chrono::seconds(10000)); |
| 31 | }); |
| 32 | openhd::AsyncHandle::instance().execute_async("QUICK_TASK", []() { |
| 33 | std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 34 | }); |
| 35 | while (openhd::AsyncHandle::instance().get_n_current_tasks()) { |
| 36 | // Wait until all tasks are finished |
| 37 | std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 38 | } |
| 39 | return 0; |
| 40 | } |
nothing calls this directly
no test coverage detected