module Kernel
def silence_warnings
def silence_warnings old_verbose, $VERBOSE = $VERBOSE, nil yield ensure $VERBOSE = old_verbose end
def sleep(*args)
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(args[0]) ensure Thread.current[:em_synchrony_sleep_hook_called] = false end else orig_sleep(*args) end end