ruby-changes:47059
From: ko1 <ko1@a...>
Date: Mon, 26 Jun 2017 14:30:12 +0900 (JST)
Subject: [ruby-changes:47059] ko1:r59174 (trunk): Do not store/restore Thread#status on fiber switching.
ko1 2017-06-26 14:30:07 +0900 (Mon, 26 Jun 2017) New Revision: 59174 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59174 Log: 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. Modified files: trunk/cont.c Index: cont.c =================================================================== --- cont.c (revision 59173) +++ cont.c (revision 59174) @@ -413,7 +413,7 @@ cont_save_thread(rb_context_t *cont, rb_ https://github.com/ruby/ruby/blob/trunk/cont.c#L413 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) https://github.com/ruby/ruby/blob/trunk/cont.c#L560 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/