Skip to content

Commit 21099b5

Browse files
committed
Fix signal handling in child threads.
1 parent 16daea1 commit 21099b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/async/container/threaded.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def exec(*arguments, ready: true, **options)
9090
def self.fork(**options)
9191
self.new(**options) do |thread|
9292
::Thread.new do
93-
yield Instance.for(thread)
93+
# This could be a configuration option (see forked implementation too):
94+
::Thread.handle_interrupt(SignalException => :immediate) do
95+
yield Instance.for(thread)
96+
end
9497
end
9598
end
9699
end

0 commit comments

Comments
 (0)