Skip to content

Commit 036ed68

Browse files
committed
Handle nil @mon_data in MonitorMixin#mon_synchronize
After freeze clears @mon_data, just yield without synchronization.
1 parent 575bde2 commit 036ed68

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/monitor.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ def mon_owned?
144144
# +MonitorMixin+.
145145
#
146146
def mon_synchronize(&b)
147-
@mon_data.synchronize(&b)
147+
if @mon_data
148+
@mon_data.synchronize(&b)
149+
else
150+
yield
151+
end
148152
end
149153
alias synchronize mon_synchronize
150154

0 commit comments

Comments
 (0)