
Hello. Thanks for replying.
No. There is no crash, just illegal instruction. And it happens after
the function run over.
After recheck the document,
https://www.boost.org/doc/libs/1_63_0/doc/html/boost_asio/using.html
BOOST_ASIO_DISABLE_THREADS
Explicitly disables Boost.Asio's threading support, independent of
whether or not Boost as a whole supports threads.
I find by -DBOOST_ASIO_DISABLE_THREADS the code works fine.
Still don't know why
On Thu, Dec 21, 2023 at 2:35 AM Ruben Perez
The code looks like below: void myTask(const char *text) { sleep(5); /*for(;;) { //sleep(1); }*/ cout<<"text is "<
Does the problem happen if you call any function other than sleep? Doing a blocking sleep in an async task is something to avoid in general. It may be causing interferences with asio's internal scheduler.