Boost logo

Boost Users :

Subject: [Boost-users] [asio] io_service::run() never returns and is blocking my thread
From: Robert Dailey (rcdailey_at_[hidden])
Date: 2009-08-27 16:01:38


Hello,

I'm currently using a serial_port object to call async_read_some().
This results in io_service::run() blocking until at least 1 byte or
more can be read from the serial port. If nothing is ever sent, then I
can not safely exit the thread in which io_service::run() is executing
in. In other words, a call to join() on that thread hangs indefinitely
until data is received. My completion callback is not executed at all
until data arrives for reading.

How can I force run() to return when I interrupt my thread?

---------
Robert Dailey


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net