Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2007-10-29 09:06:39


Author: chris_kohlhoff
Date: 2007-10-29 09:06:39 EDT (Mon, 29 Oct 2007)
New Revision: 40547
URL: http://svn.boost.org/trac/boost/changeset/40547

Log:
Ensure the task handler is put back on the queue after polling.

Text files modified:
   trunk/boost/asio/detail/task_io_service.hpp | 6 ++++--
   1 files changed, 4 insertions(+), 2 deletions(-)

Modified: trunk/boost/asio/detail/task_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/task_io_service.hpp (original)
+++ trunk/boost/asio/detail/task_io_service.hpp 2007-10-29 09:06:39 EDT (Mon, 29 Oct 2007)
@@ -225,16 +225,18 @@
         {
           bool more_handlers = (!handler_queue_.empty());
           task_interrupted_ = more_handlers || polling;
- lock.unlock();
 
           // If the task has already run and we're polling then we're done.
           if (task_has_run && polling)
           {
+ task_interrupted_ = true;
+ handler_queue_.push(&task_handler_);
             ec = boost::system::error_code();
             return 0;
           }
           task_has_run = true;
-
+
+ lock.unlock();
           task_cleanup c(lock, *this);
 
           // Run the task. May throw an exception. Only block if the handler


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk