Project

General

Profile

This project is closed and read-only.

Actions

Backport #2240

closed

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

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

Added by nahi (Hiroshi Nakamura) almost 17 years ago. Updated over 15 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: PDF Atom