Actions
Bug #20907
closedFiber scheduler does not correctly re-lock mutex if `Mutex#sleep` is interrupted.
Description
The following test fails with a ThreadError
instead of a RuntimeError
:
def test_condition_variable
condition_variable = ::Thread::ConditionVariable.new
mutex = ::Thread::Mutex.new
error = nil
thread = Thread.new do
Thread.current.report_on_exception = false
scheduler = Scheduler.new
Fiber.set_scheduler scheduler
fiber = Fiber.schedule do
begin
mutex.synchronize do
condition_variable.wait(mutex)
end
rescue => error
end
end
fiber.raise(RuntimeError)
end
thread.join
assert_kind_of RuntimeError, error
end
Updated by Anonymous about 2 months ago
- Status changed from Open to Closed
Applied in changeset git|a8c2d5e7bee5fad0965baeb58d312ddc5932ec26.
Ensure fiber scheduler re-acquires mutex when interrupted from sleep. (#12158)
[Bug #20907]
Updated by nagachika (Tomoyuki Chikanaga) about 2 months ago
- Backport changed from 3.1: REQUIRED, 3.2: REQUIRED, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED
ruby_3_2 87249cbddb5dbac16cb7f0fa33958a42389759cb merged revision(s) a8c2d5e7bee5fad0965baeb58d312ddc5932ec26.
Updated by k0kubun (Takashi Kokubun) 6 days ago
- Backport changed from 3.1: REQUIRED, 3.2: DONE, 3.3: REQUIRED to 3.1: REQUIRED, 3.2: DONE, 3.3: DONE
ruby_3_3 commit:f19831a15d680fd995ceaecad1157282be7182dc merged revision(s) a8c2d5e7bee5fad0965baeb58d312ddc5932ec26.
Actions
Like0
Like0Like0Like0