summaryrefslogtreecommitdiff
path: root/test/monitor
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2021-04-27 18:42:50 +0200
committerBenoit Daloze <eregontp@gmail.com>2021-04-27 18:42:50 +0200
commit3a3b19b2bba49e5d6f1cf13764eb6dd701397be9 (patch)
treeda5bb4f720bfe4254b30050ed3dbb74af60457a0 /test/monitor
parent1c1c91535c4f8ebc2d1ccfb63076632d53604401 (diff)
Fix Monitor to lock per Fiber, like Mutex [Bug #17827]
Diffstat (limited to 'test/monitor')
-rw-r--r--test/monitor/test_monitor.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb
index 734b639..0f17d58 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