merge revision(s) 57595: [Backport #8996]

check thread deadness correctly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@58108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2017-03-25 17:27:37 +00:00
parent da0e21528b
commit f60e5af02d
3 changed files with 18 additions and 1 deletions

View file

@ -2063,6 +2063,13 @@ rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv)
else {
exc = rb_make_exception(argc, argv);
}
/* making an exception object can switch thread,
so we need to check thread deadness again */
if (rb_threadptr_dead(th)) {
return Qnil;
}
rb_threadptr_setup_exception(GET_THREAD(), exc, Qundef);
rb_threadptr_pending_interrupt_enque(th, exc);
rb_threadptr_interrupt(th);