|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62555 - trunk/libs/thread/src/win32
From: anthony_at_[hidden]
Date: 2010-06-08 04:40:48
Author: anthonyw
Date: 2010-06-08 04:40:46 EDT (Tue, 08 Jun 2010)
New Revision: 62555
URL: http://svn.boost.org/trac/boost/changeset/62555
Log:
Updated get_due_time to handle the case where a "tick" is less than
100ns, trac issue #2447
Text files modified:
trunk/libs/thread/src/win32/thread.cpp | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2010-06-08 04:40:46 EDT (Tue, 08 Jun 2010)
@@ -356,7 +356,21 @@
else
{
long const hundred_nanoseconds_in_one_second=10000000;
- due_time.QuadPart+=target_time.abs_time.time_of_day().fractional_seconds()*(hundred_nanoseconds_in_one_second/target_time.abs_time.time_of_day().ticks_per_second());
+ long const ticks_per_second=target_time.abs_time.time_of_day().ticks_per_second();
+ if(ticks_per_second>hundred_nanoseconds_in_one_second)
+ {
+ long const ticks_per_hundred_nanoseconds=
+ ticks_per_second/hundred_nanoseconds_in_one_second;
+ due_time.QuadPart+=
+ target_time.abs_time.time_of_day().fractional_seconds()/
+ ticks_per_hundred_nanoseconds;
+ }
+ else
+ {
+ due_time.QuadPart+=
+ target_time.abs_time.time_of_day().fractional_seconds()*
+ (hundred_nanoseconds_in_one_second/ticks_per_second);
+ }
}
}
return due_time;
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