diff options
author | Benoit Daloze <eregontp@gmail.com> | 2021-04-27 18:42:50 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2021-04-27 18:42:50 +0200 |
commit | 3a3b19b2bba49e5d6f1cf13764eb6dd701397be9 (patch) | |
tree | da5bb4f720bfe4254b30050ed3dbb74af60457a0 /test/monitor/test_monitor.rb | |
parent | 1c1c91535c4f8ebc2d1ccfb63076632d53604401 (diff) |
Fix Monitor to lock per Fiber, like Mutex [Bug #17827]
Diffstat (limited to 'test/monitor/test_monitor.rb')
-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 |