diff options
author | Koichi Sasada <[email protected]> | 2019-10-20 14:21:04 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2019-10-20 14:21:04 +0900 |
commit | a0a3c701816c2fe4ab6e940c6cf5638756ceb6dc (patch) | |
tree | 65435149e73f1b30308b8c3446af8e3d3a5395ca /ext/monitor/lib | |
parent | caac5f777ae288b5982708b8690e712e1cae0cf6 (diff) |
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.
Diffstat (limited to 'ext/monitor/lib')
-rw-r--r-- | ext/monitor/lib/monitor.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/ext/monitor/lib/monitor.rb b/ext/monitor/lib/monitor.rb index dba942c89a..f6b3023dd7 100644 --- a/ext/monitor/lib/monitor.rb +++ b/ext/monitor/lib/monitor.rb @@ -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 |