Thread scheduler implementation
| 176 | |
| 177 | // Thread scheduler implementation |
| 178 | void thread_scheduler_impl::schedule(task_run_handle t) |
| 179 | { |
| 180 | // A shared_ptr is used here because not all implementations of |
| 181 | // std::thread support move-only objects. |
| 182 | std::thread([](const std::shared_ptr<task_run_handle>& t) { |
| 183 | t->run(); |
| 184 | }, std::make_shared<task_run_handle>(std::move(t))).detach(); |
| 185 | } |
| 186 | |
| 187 | } // namespace detail |
| 188 |