aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-26 05:30:07 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-26 05:30:07 +0000
commit3143ffecefdd0ead228978436f1366bc906019c8 (patch)
treeeb5684e859514f25f63bddcfa2b798325eb1efab /cont.c
parent7e8ce63e8a3af23f56f47e240cf07b3dfa0bd291 (diff)
downloadruby-3143ffecefdd0ead228978436f1366bc906019c8.tar.gz
Do not store/restore Thread#status on fiber switching.
* cont.c (cont_restore_thread): On Fiber switching, thread status shold be THREAD_RUNNABLE so that we don't need to store/restore this field. * cont.c (cont_save_thread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cont.c b/cont.c
index e5cffce9e0..e680e20811 100644
--- a/cont.c
+++ b/cont.c
@@ -413,7 +413,7 @@ cont_save_thread(rb_context_t *cont, rb_thread_t *th)
sth->local_storage = th->local_storage;
sth->safe_level = th->safe_level;
sth->raised_flag = th->raised_flag;
- sth->status = th->status;
+ VM_ASSERT(th->status == THREAD_RUNNABLE);
sth->tag = th->tag;
sth->protect_tag = th->protect_tag;
sth->errinfo = th->errinfo;
@@ -560,7 +560,7 @@ cont_restore_thread(rb_context_t *cont)
th->ec.cfp = sth->ec.cfp;
th->safe_level = sth->safe_level;
th->raised_flag = sth->raised_flag;
- th->status = sth->status;
+ VM_ASSERT(sth->status == THREAD_RUNNABLE);
th->tag = sth->tag;
th->protect_tag = sth->protect_tag;
th->errinfo = sth->errinfo;