diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-25 17:13:49 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-25 17:13:49 +0000 |
commit | da0e21528bd64a931e2f956c216455d7180f57d8 (patch) | |
tree | e37038c1a7f34da2c30ebbebe3c30c9d09bf960d /eval.c | |
parent | 134c045f1d5eb7273bba721fc1c997050c43e24d (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_2@58107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -595,6 +595,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) { |