lib/em-synchrony/kernel.rb in em-synchrony-1.0.5 vs lib/em-synchrony/kernel.rb in em-synchrony-1.0.6
- old
+ new
@@ -8,20 +8,20 @@
class << self
attr_accessor :em_synchrony_sleep_hook
end
# Monkey-patch
- def sleep(sleep_time)
+ def sleep(*args)
if Kernel.em_synchrony_sleep_hook &&
EM.reactor_thread? &&
!Thread.current[:em_synchrony_sleep_hook_called]
begin
Thread.current[:em_synchrony_sleep_hook_called] = true
- Kernel.em_synchrony_sleep_hook.call(sleep_time)
+ Kernel.em_synchrony_sleep_hook.call(args[0])
ensure
Thread.current[:em_synchrony_sleep_hook_called] = false
end
else
- orig_sleep(sleep_time)
+ orig_sleep(*args)
end
end
end