diff options
author | Bert Belder <bertbelder@gmail.com> | 2011-07-05 01:31:00 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2011-07-05 01:31:23 +0200 |
commit | 1037f5c11369566b33debc47dedac2a1c65dae68 (patch) | |
tree | ac856103daa7d78de13fbd6634995cf9850b470e /lib | |
parent | 222f85fdf4ac43bac316eceb8582200ac5b821c4 (diff) | |
download | android-node-v8-1037f5c11369566b33debc47dedac2a1c65dae68.tar.gz android-node-v8-1037f5c11369566b33debc47dedac2a1c65dae68.tar.bz2 android-node-v8-1037f5c11369566b33debc47dedac2a1c65dae68.zip |
Fix bug in timers_uv timeout recomputation
Closes #1209
Diffstat (limited to 'lib')
-rw-r--r-- | lib/timers_uv.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/timers_uv.js b/lib/timers_uv.js index 2c377873c2..59b016ef3b 100644 --- a/lib/timers_uv.js +++ b/lib/timers_uv.js @@ -67,8 +67,7 @@ function insert(item, msecs) { list.ontimeout = function() { debug('timeout callback ' + msecs); - // TODO - don't stop and start the watcher all the time. - // just set its repeat + var now = new Date(); debug('now: ' + now); @@ -76,7 +75,7 @@ function insert(item, msecs) { while (first = L.peek(list)) { var diff = now - first._idleStart; if (diff + 1 < msecs) { - list.start(diff, 0); + list.start(msecs - diff, 0); debug(msecs + ' list wait because diff is ' + diff); return; } else { |