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

Updated by nahi (Hiroshi Nakamura) almost 17 years ago Actions #1

=begin
NOTE: 1.9 (ruby 1.9.2dev (2009-10-20 trunk 25411) [i686-linux]) is safe.
=end

Updated by nahi (Hiroshi Nakamura) almost 17 years ago Actions #2

  • 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) almost 17 years ago Actions #3

=begin
Title must be '... when the scheduled thread is not alive' as you see the fix.
=end

Updated by shyouhei (Shyouhei Urabe) almost 17 years ago Actions #4

  • 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) over 16 years ago Actions #5

  • 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

Actions

Also available in: PDF Atom