Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60939 - trunk/boost/asio/detail
From: chris_at_[hidden]
Date: 2010-03-30 08:30:00


Author: chris_kohlhoff
Date: 2010-03-30 08:30:00 EDT (Tue, 30 Mar 2010)
New Revision: 60939
URL: http://svn.boost.org/trac/boost/changeset/60939

Log:
Don't perform a speculative read when an out-of-band read is pending.

Text files modified:
   trunk/boost/asio/detail/dev_poll_reactor.hpp | 14 ++++++++------
   trunk/boost/asio/detail/epoll_reactor.hpp | 4 +++-
   2 files changed, 11 insertions(+), 7 deletions(-)

Modified: trunk/boost/asio/detail/dev_poll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/dev_poll_reactor.hpp (original)
+++ trunk/boost/asio/detail/dev_poll_reactor.hpp 2010-03-30 08:30:00 EDT (Tue, 30 Mar 2010)
@@ -126,18 +126,20 @@
 
     if (allow_speculative)
     {
- if (!op_queue_[op_type].has_operation(descriptor))
+ if (op_type != read_op || !op_queue_[except_op].has_operation(descriptor))
       {
- if (op->perform())
+ if (!op_queue_[op_type].has_operation(descriptor))
         {
- lock.unlock();
- io_service_.post_immediate_completion(op);
- return;
+ if (op->perform())
+ {
+ lock.unlock();
+ io_service_.post_immediate_completion(op);
+ return;
+ }
         }
       }
     }
 
-
     bool first = op_queue_[op_type].enqueue_operation(descriptor, op);
     io_service_.work_started();
     if (first)

Modified: trunk/boost/asio/detail/epoll_reactor.hpp
==============================================================================
--- trunk/boost/asio/detail/epoll_reactor.hpp (original)
+++ trunk/boost/asio/detail/epoll_reactor.hpp 2010-03-30 08:30:00 EDT (Tue, 30 Mar 2010)
@@ -180,7 +180,9 @@
 
     if (descriptor_data->op_queue_[op_type].empty())
     {
- if (allow_speculative)
+ if (allow_speculative
+ && (op_type != read_op
+ || descriptor_data->op_queue_[except_op].empty()))
       {
         if (op->perform())
         {


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