| 360 | } |
| 361 | |
| 362 | void deadline_timer_thread_test() |
| 363 | { |
| 364 | boost::asio::io_context ioc; |
| 365 | boost::asio::executor_work_guard<boost::asio::io_context::executor_type> work |
| 366 | = boost::asio::make_work_guard(ioc); |
| 367 | boost::asio::deadline_timer t1(ioc); |
| 368 | boost::asio::deadline_timer t2(ioc); |
| 369 | int count = 0; |
| 370 | |
| 371 | boost::asio::detail::thread th(boost::bind(io_context_run, &ioc)); |
| 372 | |
| 373 | t2.expires_from_now(boost::posix_time::seconds(2)); |
| 374 | t2.wait(); |
| 375 | |
| 376 | t1.expires_from_now(boost::posix_time::seconds(2)); |
| 377 | t1.async_wait(boost::bind(increment, &count)); |
| 378 | |
| 379 | t2.expires_from_now(boost::posix_time::seconds(4)); |
| 380 | t2.wait(); |
| 381 | |
| 382 | ioc.stop(); |
| 383 | th.join(); |
| 384 | |
| 385 | BOOST_ASIO_CHECK(count == 1); |
| 386 | } |
| 387 | |
| 388 | void deadline_timer_async_result_test() |
| 389 | { |
nothing calls this directly
no test coverage detected