# File lib/mcollective/windows_daemon.rb, line 13 def service_main Log.debug("Starting Windows Service Daemon") @runner = Runner.new(nil) @runner.main_loop # On shut down there may be threads outside of the runner's context that are # in a sleeping state, causing the stop action to wait for them to cleanly exit. # We get around this by iterating the list of threads and killing everything that # isn't the main thread, letting us shut down cleanly. Thread.list.each do |t| if t != Thread.current t.kill end end end