aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:49:30 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:49:30 +0000
commitbc648b12cbb35a8a553e7cc47ed2b4ba01906cbb (patch)
treec0ee96bf9da5df9607397c841b2b7953a41d4c04 /cont.c
parent87afbe4685bf5d39d94e312b78515d50b9364f4d (diff)
downloadruby-bc648b12cbb35a8a553e7cc47ed2b4ba01906cbb.tar.gz
introduce rb_thread_ptr() to replace GetThreadPtr().
* vm_core.h (rb_thread_ptr): added to replace GetThreadPtr() macro. * thread.c (in some functions: use "target_th" instead of "th" to make clear that it is not a current thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cont.c b/cont.c
index 70ffd41e73..c17ee15807 100644
--- a/cont.c
+++ b/cont.c
@@ -196,9 +196,9 @@ cont_mark(void *ptr)
}
else {
/* fiber */
- rb_thread_t *th;
+ rb_thread_t *th = rb_thread_ptr(cont->saved_thread.self);
rb_fiber_t *fib = (rb_fiber_t*)cont;
- GetThreadPtr(cont->saved_thread.self, th);
+
if ((th->fiber != fib) && fib->status == FIBER_RUNNING) {
rb_gc_mark_locations(cont->machine.stack,
cont->machine.stack + cont->machine.stack_size);
@@ -1514,9 +1514,8 @@ rb_fiber_yield(int argc, const VALUE *argv)
void
rb_fiber_reset_root_local_storage(VALUE thval)
{
- rb_thread_t *th;
+ rb_thread_t *th = rb_thread_ptr(thval);
- GetThreadPtr(thval, th);
if (th->root_fiber && th->root_fiber != th->fiber) {
th->ec.local_storage = th->root_fiber->cont.saved_thread.ec.local_storage;
}