Backport #2240
closedreturning from Monitor#synchronize causes 'ThreadError: killed thread' when no waiting thread is alive
Description
=begin
def test_killed_thread_in_synchronize
ary = []
queue = Queue.new
t1 = Thread.start {
queue.pop
@monitor.synchronize {
ary << :t1
}
}
t2 = Thread.start {
queue.pop
@monitor.synchronize {
ary << :t2
}
}
@monitor.synchronize do
queue.enq(nil)
queue.enq(nil)
assert_equal([], ary)
t1.kill
t2.kill
ary << :main
end
assert_equal([:main], ary)
end
=end
Updated by nahi (Hiroshi Nakamura) over 14 years ago
=begin
NOTE: 1.9 (ruby 1.9.2dev (2009-10-20 trunk 25411) [i686-linux]) is safe.
=end
Updated by nahi (Hiroshi Nakamura) over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r25420.
Hiroshi, thank you for your reporting of the issue.
You have greatfully contributed toward Ruby.
May Ruby be with you.
=end
Updated by nahi (Hiroshi Nakamura) over 14 years ago
=begin
Title must be '... when the scheduled thread is not alive' as you see the fix.
=end
Updated by shyouhei (Shyouhei Urabe) over 14 years ago
- Status changed from Closed to Assigned
- Assignee set to wyhaines (Kirk Haines)
=begin
1.8.6 also fails on this test case.
=end
Updated by wyhaines (Kirk Haines) almost 14 years ago
- Status changed from Assigned to Closed
=begin
This issue was solved with changeset r28232.
Hiroshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end