1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

delegate synchronize method

Delegate MonitorMixin#synchronize body to Monitor#synchronize.
It makes guarantee interrupt safe (because Monitor#synchronize is
written in C). I thought Ruby implementation is also safe, but I
got stuck failure <http://ci.rvm.jp/results/trunk_test@P895/2327639>
so that I introduce this fix to guarantee interrupt safe.
This commit is contained in:
Koichi Sasada 2019-10-20 14:21:04 +09:00
parent caac5f777a
commit a0a3c70181

View file

@ -205,12 +205,7 @@ module MonitorMixin
# +MonitorMixin+.
#
def mon_synchronize(&b)
@mon_data.enter
begin
yield
ensure
@mon_data.exit
end
@mon_data.synchronize(&b)
end
alias synchronize mon_synchronize