diff options
author | nagachika <nagachika@ruby-lang.org> | 2021-05-23 14:36:05 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-05-23 14:36:05 +0900 |
commit | f9196de1dee6f5ab8b6fe115070b92775a3500fe (patch) | |
tree | 8b919deccbc736bcf2c533f3b7d2e96eb488ad5b /test/monitor | |
parent | 31816356eee6313fe968eecd4cd3ad9ac4848819 (diff) |
merge revision(s) 3a3b19b2bba49e5d6f1cf13764eb6dd701397be9: [Backport #17827]
Fix Monitor to lock per Fiber, like Mutex [Bug #17827]
---
ext/monitor/monitor.c | 10 +++++-----
test/monitor/test_monitor.rb | 7 +++++++
2 files changed, 12 insertions(+), 5 deletions(-)
Diffstat (limited to 'test/monitor')
-rw-r--r-- | test/monitor/test_monitor.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb index 734b639d4c..0f17d58f71 100644 --- a/test/monitor/test_monitor.rb +++ b/test/monitor/test_monitor.rb @@ -10,6 +10,13 @@ class TestMonitor < Test::Unit::TestCase @monitor = Monitor.new end + def test_enter_in_different_fibers + @monitor.enter + Fiber.new { + assert_equal false, @monitor.try_enter + }.resume + end + def test_enter ary = [] queue = Queue.new |