lib/kernel/sync.rb in async-1.28.5 vs lib/kernel/sync.rb in async-1.28.6
- old
+ new
@@ -26,9 +26,12 @@
# 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(&block).wait
+ ::Async::Reactor.run(
+ finished: ::Async::Condition.new,
+ &block
+ ).wait
end
end
end