mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
(test_main_thread_status_at_exit) wait until the thread enter the begin clause.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
34ac0ea7bf
commit
c7b2577178
1 changed files with 3 additions and 0 deletions
|
@ -818,8 +818,10 @@ _eom
|
||||||
|
|
||||||
def test_main_thread_status_at_exit
|
def test_main_thread_status_at_exit
|
||||||
assert_in_out_err([], <<-'INPUT', ["false false aborting"], [])
|
assert_in_out_err([], <<-'INPUT', ["false false aborting"], [])
|
||||||
|
q = Queue.new
|
||||||
Thread.new(Thread.current) {|mth|
|
Thread.new(Thread.current) {|mth|
|
||||||
begin
|
begin
|
||||||
|
q.push nil
|
||||||
mth.run
|
mth.run
|
||||||
Thead.pass until mth.stop?
|
Thead.pass until mth.stop?
|
||||||
p :mth_stopped # don't run if killed by rb_thread_terminate_all
|
p :mth_stopped # don't run if killed by rb_thread_terminate_all
|
||||||
|
@ -827,6 +829,7 @@ Thread.new(Thread.current) {|mth|
|
||||||
puts "#{mth.alive?} #{mth.status} #{Thread.current.status}"
|
puts "#{mth.alive?} #{mth.status} #{Thread.current.status}"
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
q.pop
|
||||||
INPUT
|
INPUT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue