Project

General

Profile

Actions

Backport #2240

closed

returning from Monitor#synchronize causes 'ThreadError: killed thread' when no waiting thread is alive

Added by nahi (Hiroshi Nakamura) over 14 years ago. Updated about 13 years ago.


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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0