|
Boost Users : |
Subject: Re: [Boost-users] [asio] reopening of serial port fails - why?
From: Igor R (boost.lists_at_[hidden])
Date: 2009-03-09 06:07:36
> Rules are:
>
> - first start do_read(),
> - then start the thread
> - after termination of the thread an io_service_.reset()
> Â is mandatory. Otherwise subsequent thread starts lead to
>  spurious behaviour. This was not clear to me and I dislike  this behaviour ...
ASIO reference explicitly states that you must call
io_service::reset() before subsequent call to io_service::run().
However, you didn't have to exit the thread that runs
io_service::run() - this's just matter of design. In the asio examples
you can find other design choices.
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