summaryrefslogtreecommitdiff
path: root/lib/monitor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/monitor.rb')
-rw-r--r--lib/monitor.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/monitor.rb b/lib/monitor.rb
index 999795c3d0..5b6b14e305 100644
--- a/lib/monitor.rb
+++ b/lib/monitor.rb
@@ -225,11 +225,13 @@ module MonitorMixin
# +MonitorMixin+.
#
def mon_synchronize
- mon_enter
+ # Prevent interrupt on handling interrupts; for example timeout errors
+ # it may break locking state.
+ Thread.handle_interrupt(Exception => :never){ mon_enter }
begin
yield
ensure
- mon_exit
+ Thread.handle_interrupt(Exception => :never){ mon_exit }
end
end
alias synchronize mon_synchronize