module Kernel

def Sync(&block)

Run the given block of code synchronously, but within a reactor if not already in one.
def Sync(&block)
	if task = ::Async::Task.current?
		yield task
	else
		::Async::Reactor.run(
			finished: ::Async::Condition.new,
			&block
		).wait
	end
end