From b3ddec4a1910b1a7e50121f9cf3a6cea93b5e0ef Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 8 Jul 2005 01:08:05 +0000 Subject: [PATCH] When time goes backwards, cope as best we can by simply not throttling. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1675 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../samskivert/src/java/com/samskivert/util/Throttle.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/Throttle.java b/projects/samskivert/src/java/com/samskivert/util/Throttle.java index 6abab302..a73c35ae 100644 --- a/projects/samskivert/src/java/com/samskivert/util/Throttle.java +++ b/projects/samskivert/src/java/com/samskivert/util/Throttle.java @@ -117,7 +117,10 @@ public class Throttle { // if the oldest operation was performed less than _period ago, we // need to throttle - return (timeStamp - _ops[_lastOp]) < _period; + long elapsed = timeStamp - _ops[_lastOp]; + // if negative time elapsed, we must be running on windows. + // Let's just cope by not throttling. + return (elapsed >= 0 && elapsed < _period); } /**