diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-03 01:11:37 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-03 01:11:37 +0000 |
| commit | 5dc6d20cc3535f21cf267923f66b98fac1d93309 (patch) | |
| tree | 149a57533fc476631e2372105b7aebac70eb80e8 /test/ruby | |
| parent | aea7069f79236a78c9dc614a8300502d3e855fa4 (diff) | |
merge revision(s) r34038,34099:
* thread_pthread.c (ubf_select): call rb_thread_wakeup_timer_thread()
only when it is not timer_thread. [Bug #5757] [ruby-dev:44985]
patched by Tomoyuki Chikanaga.
* thread_pthread.c (ping_signal_thread_list): remove return value.
* thread_pthread.c (check_signal_thread_list): add a new function to
check if signal thread list is empty.
* thread_pthread.c (thread_timer): check signal thread list after
timer_thread_function(). main thread might be added into signal thread
list during timer_thread_function().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_thread.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 57e02849b9..209d4b006f 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -685,4 +685,19 @@ class TestThreadGroup < Test::Unit::TestCase t.join assert_equal(nil, t.backtrace) end + + def test_thread_timer_and_interrupt + bug5757 = '[ruby-dev:44985]' + t0 = Time.now.to_f + pid = spawn(EnvUtil.rubybin, '-e', '$stdin.read') + sleep 1; + Process.kill(:SIGQUIT, pid) + Process.wait(pid) + s = $? + assert_equal([false, true, false], + [s.exited?, s.signaled?, s.stopped?], + "[s.exited?, s.signaled?, s.stopped?]") + t1 = Time.now.to_f + assert_in_delta(t1 - t0, 1, 1) + end end |
