aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-26 07:46:11 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-26 07:46:11 +0000
commit9dfb475a35cd60b72bc9f8565008b4bd52c062a9 (patch)
tree3162d4c66a6412d9019fcace619ed3a8011329fc /cont.c
parent9878a1d7834902262aea54f210f87a9e21f2607f (diff)
downloadruby-9dfb475a35cd60b72bc9f8565008b4bd52c062a9.tar.gz
copy ec on Fiber.
* cont.c (cont_restore_thread): on Fiber we only need to copy ec struct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/cont.c b/cont.c
index 24d11fcfcc..16c8297fe6 100644
--- a/cont.c
+++ b/cont.c
@@ -545,22 +545,24 @@ cont_restore_thread(rb_context_t *cont)
#else
MEMCPY(th->ec.stack, cont->vm_stack, VALUE, sth->ec.stack_size);
#endif
+
+ /* other members of ec */
+ th->ec.cfp = sth->ec.cfp;
}
else {
/* fiber */
- th->ec.stack = sth->ec.stack;
+ th->ec = sth->ec;
sth->ec.stack = NULL;
- th->ec.stack_size = sth->ec.stack_size;
+
th->local_storage = sth->local_storage;
th->local_storage_recursive_hash = sth->local_storage_recursive_hash;
th->local_storage_recursive_hash_for_trace = sth->local_storage_recursive_hash_for_trace;
+
th->fiber = (rb_fiber_t*)cont;
}
- th->ec.cfp = sth->ec.cfp;
th->safe_level = sth->safe_level;
th->raised_flag = sth->raised_flag;
- VM_ASSERT(sth->status == THREAD_RUNNABLE);
th->tag = sth->tag;
th->protect_tag = sth->protect_tag;
th->errinfo = sth->errinfo;
@@ -568,6 +570,8 @@ cont_restore_thread(rb_context_t *cont)
th->root_lep = sth->root_lep;
th->root_svar = sth->root_svar;
th->ensure_list = sth->ensure_list;
+
+ VM_ASSERT(sth->status == THREAD_RUNNABLE);
}
#if FIBER_USE_NATIVE