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:
parent
caac5f777a
commit
a0a3c70181
1 changed files with 1 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue