Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62497 - trunk/boost/asio/detail
From: chris_at_[hidden]
Date: 2010-06-06 19:28:59


Author: chris_kohlhoff
Date: 2010-06-06 19:28:58 EDT (Sun, 06 Jun 2010)
New Revision: 62497
URL: http://svn.boost.org/trac/boost/changeset/62497

Log:
Fix handling of small but non-zero timeouts. Fixes #4205.

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

Modified: trunk/boost/asio/detail/timer_queue.hpp
==============================================================================
--- trunk/boost/asio/detail/timer_queue.hpp (original)
+++ trunk/boost/asio/detail/timer_queue.hpp 2010-06-06 19:28:58 EDT (Sun, 06 Jun 2010)
@@ -98,8 +98,10 @@
 
     if (duration > boost::posix_time::milliseconds(max_duration))
       duration = boost::posix_time::milliseconds(max_duration);
- else if (duration < boost::posix_time::milliseconds(0))
+ else if (duration <= boost::posix_time::milliseconds(0))
       duration = boost::posix_time::milliseconds(0);
+ else if (duration < boost::posix_time::milliseconds(1))
+ duration = boost::posix_time::milliseconds(1);
 
     return duration.total_milliseconds();
   }
@@ -115,8 +117,10 @@
 
     if (duration > boost::posix_time::microseconds(max_duration))
       duration = boost::posix_time::microseconds(max_duration);
- else if (duration < boost::posix_time::microseconds(0))
+ else if (duration <= boost::posix_time::microseconds(0))
       duration = boost::posix_time::microseconds(0);
+ else if (duration < boost::posix_time::microseconds(1))
+ duration = boost::posix_time::microseconds(1);
 
     return duration.total_microseconds();
   }


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