summaryrefslogtreecommitdiff
path: root/eval.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 /eval.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 'eval.c')
-rw-r--r--eval.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index e3dbb9eb66..3a9e25c8b4 100644
--- a/eval.c
+++ b/eval.c
@@ -581,6 +581,17 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause)
}
}
+void
+rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause)
+{
+ if (cause == Qundef) {
+ cause = get_thread_errinfo(th);
+ }
+ if (cause != mesg) {
+ rb_ivar_set(mesg, id_cause, cause);
+ }
+}
+
static void
rb_longjmp(int tag, volatile VALUE mesg, VALUE cause)
{