| 367 | } |
| 368 | |
| 369 | void system_timer_thread_test() |
| 370 | { |
| 371 | boost::asio::io_context ioc; |
| 372 | boost::asio::executor_work_guard<boost::asio::io_context::executor_type> work |
| 373 | = boost::asio::make_work_guard(ioc); |
| 374 | boost::asio::system_timer t1(ioc); |
| 375 | boost::asio::system_timer t2(ioc); |
| 376 | int count = 0; |
| 377 | |
| 378 | boost::asio::detail::thread th(bindns::bind(io_context_run, &ioc)); |
| 379 | |
| 380 | t2.expires_after(boost::asio::chrono::seconds(2)); |
| 381 | t2.wait(); |
| 382 | |
| 383 | t1.expires_after(boost::asio::chrono::seconds(2)); |
| 384 | t1.async_wait(bindns::bind(increment, &count)); |
| 385 | |
| 386 | t2.expires_after(boost::asio::chrono::seconds(4)); |
| 387 | t2.wait(); |
| 388 | |
| 389 | ioc.stop(); |
| 390 | th.join(); |
| 391 | |
| 392 | BOOST_ASIO_CHECK(count == 1); |
| 393 | } |
| 394 | |
| 395 | boost::asio::system_timer make_timer(boost::asio::io_context& ioc, int* count) |
| 396 | { |
nothing calls this directly
no test coverage detected