summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 08:59:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-09 08:59:48 +0000
commit646c53895f80358d153d04f04b726d0d14388cf2 (patch)
tree2a0259c164d7c8c5707931ab306be7ec0015806d /thread.c
parentb5f3a113f55a81ce19c36b50d1ef234ac518d510 (diff)
thread.c: set cause by Thread#raise
* thread.c (rb_threadptr_raise): set cause from the called thread, but not from the thread to be interrupted. [ruby-core:77222] [Bug #12741] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56125 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 6404bd27d7..46077f6ea4 100644
--- a/thread.c
+++ b/thread.c
@@ -2084,6 +2084,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)
{
@@ -2099,6 +2101,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;