提交 649d8173 编写于 作者: M Matthew Draper

Order of execution is only guaranteed if upgrading

If the thread isn't yet holding any form of lock, it has no claim over
what may / may not run while it's blocked.
上级 b3d78e8c
......@@ -52,7 +52,7 @@ def start_exclusive(purpose: nil, compatible: [], no_wait: false)
return false if no_wait
loose_shares = @sharing.delete(Thread.current)
@waiting[Thread.current] = compatible
@waiting[Thread.current] = compatible if loose_shares
@cv.wait_while { busy?(purpose) }
......
......@@ -147,7 +147,9 @@ def test_exclusive_ordering
assert_threads_not_stuck threads
scratch_pad_mutex.synchronize do
assert_equal [:load, :load, :unload, :unload], scratch_pad
if use_upgrading
assert_equal [:load, :load, :unload, :unload], scratch_pad
end
scratch_pad.clear
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册