File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ class InterruptHandler
7
7
8
8
attr_accessor :isolate_signals , :signal_received , :reenable_on_interrupt
9
9
10
+ # Initialize safe interrupt signal handling.
10
11
def initialize
11
12
self . isolate_signals = false
12
13
self . signal_received = false
@@ -64,14 +65,19 @@ def disable_until_finished_or_interrupted
64
65
instance . isolate_signals = true
65
66
end
66
67
68
+ # Disable interrupt isolation.
67
69
def disable!
68
70
instance . isolate_signals = false
69
71
end
70
72
73
+ # Enable interrupt isolation.
71
74
def enable!
72
75
instance . isolate_signals = true
73
76
end
74
77
78
+ # Enable interrupt isolation while executing the provided block.
79
+ #
80
+ # @yield block to execute with interrupt isolation
75
81
def isolate_from_interrupts
76
82
instance . signal_received = false
77
83
instance . isolate_signals = true
You can’t perform that action at this time.
0 commit comments