id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 13567,io_context ::run() doesn't return immediately on stopped io_context due to Windows implementation,cvzakharchenko@…,chris_kohlhoff,"This code hangs, when running on Windows: {{{ boost::asio::io_context context; // 1 boost::asio::post(context, []() { for (;;); }); // 2 context.stop(); // 3 context.run(); // hangs in a handler, posted in 2 }}} [https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/io_context/stop.html io_context::stop] documentation says: Subsequent calls to run(), run_one(), poll() or poll_one() will return immediately until restart() is called. Which is, judging by example above, isn't true. Same goes for [https://www.boost.org/doc/libs/1_67_0/doc/html/boost_asio/reference/io_context/stopped.html io_context::stopped]: When an io_context object is stopped, calls to run(), run_one(), poll() or poll_one() will return immediately without invoking any handlers. and code example below: {{{ boost::asio::io_context context; // 1 boost::asio::post(context, []() { for (;;); }); // 2 context.stop(); // 3 if (context.stopped()) { context.run(); // hangs in a handler, posted in 2 } }}} When running on Linux, same code fully complies the documentation and doesn't invoke any handlers in examples provided.",Bugs,new,To Be Determined,asio,Boost 1.67.0,Problem,,"windows, io_context, stop, stopped",