From: Michal 'vorner' Vaner Date: Mon, 8 Apr 2013 12:14:46 +0000 (+0200) Subject: [2738] Use IOService::post X-Git-Tag: bind10-1.1.0beta2-release~8^2~12^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e893a8d8b65af8f4b4d01ddf0388fb2bceb52ea0;p=thirdparty%2Fkea.git [2738] Use IOService::post Instead of abusing the timer with 0 timeout, which is rejected. --- diff --git a/src/bin/resolver/bench/fake_resolution.cc b/src/bin/resolver/bench/fake_resolution.cc index 2fb6cf86c8..baa7d24203 100644 --- a/src/bin/resolver/bench/fake_resolution.cc +++ b/src/bin/resolver/bench/fake_resolution.cc @@ -114,12 +114,11 @@ FakeQueryPtr FakeInterface::receiveQuery() { // Handle all the events that are already scheduled. // As processEvents blocks until an event happens and we want to terminate - // if there are no events, we do a small trick. We schedule a timeout with - // 0 time. That'll place the event for it directly at the end of the queue. - // Then, we'll just call processEvents() until that event happens. + // if there are no events, we do a small trick. We post an event to the end + // of the queue and work until it is found. This should process all the + // events that were there already. bool processed = false; - asiolink::IntervalTimer zero_timer(service_); - zero_timer.setup(boost::bind(&processDone, &processed), 0); + service_.post(boost::bind(&processDone, &processed)); while (!processed) { processEvents(); }