Commit fec9e5c1 authored by Michal Vaner's avatar Michal Vaner
Browse files

More fixes of stopped asio::io_service

It stops itself when there's no more work and tells nobody about it. So
we need detect it was stopped (there seem to be no other way than trying
and looking at how many events it processed), reset and try again.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-config@3352 e5f2f494-b856-4b98-b285-d166d9295462
parent db9ded28
......@@ -187,12 +187,21 @@ IOService::clearServers() {
void
IOService::run() {
impl_->io_service_.run();
if (!impl_->io_service_.run()) {
// We got the io_service in stopped state and it didn't work
// Reset it and try again
impl_->io_service_.reset();
impl_->io_service_.run();
}
}
void
IOService::run_one() {
impl_->io_service_.run_one();
if (!impl_->io_service_.run_one()) {
// Same as in run() - we got it in stopped state
impl_->io_service_.reset();
impl_->io_service_.run_one();
}
}
void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment