diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-27 19:12:43 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-27 19:12:43 +0000 |
commit | 57062d91b9bfb1688151cd2393011504fd26f0d8 (patch) | |
tree | 586958dc0f4d60d96f50d9a30ebfcc20b88f9d5a /yarvcore.c | |
parent | b69b1af65002e9a70a4f33bafa35593b4618e7a4 (diff) | |
download | ruby-57062d91b9bfb1688151cd2393011504fd26f0d8.tar.gz |
* cont.c: support Fiber. Check test/ruby/test_fiber.rb for detail.
Fiber is known as "Micro Thread", "Coroutine", and other terms.
At this time, only Fiber#pass is supported to change context.
I want to know more suitable method name/API for Fiber (... do you
know more suitable class name instead of Fiber?) as "suspend/resume",
"call", "yield", "start/kick/stop/restart", ....
* eval.c, eval_intern.h, thread.c, yarvcore.c, yarvcore.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'yarvcore.c')
-rw-r--r-- | yarvcore.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/yarvcore.c b/yarvcore.c index 0530a36ca0..507a2f8c68 100644 --- a/yarvcore.c +++ b/yarvcore.c @@ -268,7 +268,7 @@ thread_mark(void *ptr) VALUE *sp = th->cfp->sp + th->mark_stack_len; rb_control_frame_t *cfp = th->cfp; rb_control_frame_t *limit_cfp = - (void *)(th->stack + th->stack_size); + (void *)(th->stack + th->stack_size); while (p < sp) { rb_gc_mark(*p++); @@ -282,18 +282,19 @@ thread_mark(void *ptr) /* mark ruby objects */ MARK_UNLESS_NULL(th->first_proc); MARK_UNLESS_NULL(th->first_args); - + MARK_UNLESS_NULL(th->thgroup); MARK_UNLESS_NULL(th->value); MARK_UNLESS_NULL(th->errinfo); MARK_UNLESS_NULL(th->local_svar); MARK_UNLESS_NULL(th->top_self); MARK_UNLESS_NULL(th->top_wrapper); + MARK_UNLESS_NULL(th->fiber); + MARK_UNLESS_NULL(th->root_fiber); rb_mark_tbl(th->local_storage); - if (GET_THREAD() != th && - th->machine_stack_start && th->machine_stack_end) { + if (GET_THREAD() != th && th->machine_stack_start && th->machine_stack_end) { yarv_machine_stack_mark(th); rb_gc_mark_locations((VALUE *)&th->machine_regs, (VALUE *)(&th->machine_regs) + |