summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-17 02:31:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-17 02:31:35 +0000
commite601e775905f356f897857759c479d5ab76b2286 (patch)
treeccaa98da5509c2fd002552b13e7cfb7973f4fa69 /thread.c
parente97ac02f8466275732a33f704480c03da722f485 (diff)
eval.c: copy special exceptions before raise
* eval.c (setup_exception): consider if the exception is frozen, but not one of special exception objects. * gc.c (rb_memerror): copy minimum objects. * thread.c (rb_threadptr_execute_interrupts): prepare special exception queued by another thread to be raised. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index a21ef7ba78..972e1b9c6e 100644
--- a/thread.c
+++ b/thread.c
@@ -2071,6 +2071,10 @@ rb_threadptr_execute_interrupts(rb_thread_t *th, int blocking_timing)
rb_threadptr_to_kill(th);
}
else {
+ if (err == th->vm->special_exceptions[ruby_error_stream_closed]) {
+ /* the only special exception to be queued accross thread */
+ err = ruby_vm_special_exception_copy(err);
+ }
/* set runnable if th was slept. */
if (th->status == THREAD_STOPPED ||
th->status == THREAD_STOPPED_FOREVER)