Boost logo

Boost Users :

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


On Thu, Aug 27, 2009 at 3:07 PM, Rutger ter Borg<rutger_at_[hidden]> wrote:
>
> Robert Dailey wrote:
>
>> 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?
>>
>
> Have you tried to close or cancel the serial port object? It should return
> your waiting handlers with an "operation interrupted" error code.

Good idea, this would have worked. However, I chose to call
io_service::poll() instead to keep my thread from being blocked in the
first place.


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