about summary refs log tree commit homepage
path: root/lib/rainbows
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-04-21 21:22:06 +0000
committerEric Wong <normalperson@yhbt.net>2011-04-21 21:41:50 +0000
commite5c4125c348104444714b5111c90016d520461d6 (patch)
tree915cb4ec3668d3e7249dc41055f74ed5f4000117 /lib/rainbows
parent71d48a01a7c257dffa22c10781c55deff64037d2 (diff)
downloadrainbows-e5c4125c348104444714b5111c90016d520461d6.tar.gz
Thread-switching sometimes takes too long under YARV, so we
force a switch since the watchdog thread is lower-priority.
Diffstat (limited to 'lib/rainbows')
-rw-r--r--lib/rainbows/thread_timeout.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rainbows/thread_timeout.rb b/lib/rainbows/thread_timeout.rb
index 44baf9a..3d28daf 100644
--- a/lib/rainbows/thread_timeout.rb
+++ b/lib/rainbows/thread_timeout.rb
@@ -93,7 +93,7 @@ class Rainbows::ThreadTimeout
           sleep(@timeout)
         else
           sec = next_expiry - Time.now
-          sec > 0.0 ? sleep(sec) : Thread.pass
+          sec > 0.0 ? sleep(sec) : Thread.pass # give other threads a chance
         end
       rescue => e
         logger.error e