summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-19 21:07:54 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-19 21:07:54 +0000
commit63818379aa3c88681daf634c5f55b2cffac68283 (patch)
treee31b97f96fd519225c7cd4355f636cff1ac9979c /thread.c
parent250fa1cbf04aeea9769be4060825ffcf21f08f91 (diff)
merge revision(s) 56125,56150: [Backport #12741]
* thread.c (rb_threadptr_raise): set cause from the called thread, but not from the thread to be interrupted. [ruby-core:77222] [Bug #12741] * test/ruby/test_exception.rb: fix thread issues. * use Queue instead of a local variable for synchronization. * join created thread to soleve leaking threads warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index e48c05e996..3ec4b900a7 100644
--- a/thread.c
+++ b/thread.c
@@ -2073,6 +2073,8 @@ rb_threadptr_ready(rb_thread_t *th)
rb_threadptr_interrupt(th);
}
+void rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause);
+
static VALUE
rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv)
{
@@ -2088,6 +2090,7 @@ rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv)
else {
exc = rb_make_exception(argc, argv);
}
+ rb_threadptr_setup_exception(GET_THREAD(), exc, Qundef);
rb_threadptr_pending_interrupt_enque(th, exc);
rb_threadptr_interrupt(th);
return Qnil;