Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52291 - trunk/boost/asio/detail
From: chris_at_[hidden]
Date: 2009-04-09 08:04:40


Author: chris_kohlhoff
Date: 2009-04-09 08:04:39 EDT (Thu, 09 Apr 2009)
New Revision: 52291
URL: http://svn.boost.org/trac/boost/changeset/52291

Log:
As a performance optimisation, add an explicit check for an empty vector of
timer queues.

Text files modified:
   trunk/boost/asio/detail/win_iocp_io_service.hpp | 13 ++++++++-----
   1 files changed, 8 insertions(+), 5 deletions(-)

Modified: trunk/boost/asio/detail/win_iocp_io_service.hpp
==============================================================================
--- trunk/boost/asio/detail/win_iocp_io_service.hpp (original)
+++ trunk/boost/asio/detail/win_iocp_io_service.hpp 2009-04-09 08:04:39 EDT (Thu, 09 Apr 2009)
@@ -436,12 +436,15 @@
         try
         {
           boost::asio::detail::mutex::scoped_lock lock(timer_mutex_);
- timer_queues_copy_ = timer_queues_;
- for (std::size_t i = 0; i < timer_queues_copy_.size(); ++i)
+ if (!timer_queues_.empty())
           {
- timer_queues_copy_[i]->dispatch_timers();
- timer_queues_copy_[i]->dispatch_cancellations();
- timer_queues_copy_[i]->complete_timers();
+ timer_queues_copy_ = timer_queues_;
+ for (std::size_t i = 0; i < timer_queues_copy_.size(); ++i)
+ {
+ timer_queues_copy_[i]->dispatch_timers();
+ timer_queues_copy_[i]->dispatch_cancellations();
+ timer_queues_copy_[i]->complete_timers();
+ }
           }
         }
         catch (...)


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