diff options
author | Koichi Sasada <[email protected]> | 2019-10-20 15:45:30 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2019-10-20 15:45:30 +0900 |
commit | a236eaa762137d7cb32b8311e0ef9a74bbb0f385 (patch) | |
tree | ccf40c23053f1aef9b8445fd8d3e8e4bd816e7a6 /ext/monitor/lib | |
parent | a0a3c701816c2fe4ab6e940c6cf5638756ceb6dc (diff) |
Native MonitorMixin::ConditionVariable#wait
MonitorMixin::ConditionVariable#wait can be interrupted just after
Monitor#exit_for_cond. So implementation in C.
Diffstat (limited to 'ext/monitor/lib')
-rw-r--r-- | ext/monitor/lib/monitor.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/ext/monitor/lib/monitor.rb b/ext/monitor/lib/monitor.rb index f6b3023dd7..b9ae03649c 100644 --- a/ext/monitor/lib/monitor.rb +++ b/ext/monitor/lib/monitor.rb @@ -105,13 +105,7 @@ module MonitorMixin # def wait(timeout = nil) @monitor.mon_check_owner - count = @monitor.__send__(:exit_for_cond) - begin - @cond.wait(@monitor.__send__(:mutex_for_cond), timeout) - return true - ensure - @monitor.__send__(:enter_for_cond, count) - end + @monitor.wait_for_cond(@cond, timeout) end # |