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 | e5f3b1a5cc39db25503f1d175fbd0f93c04a85c6 (patch) | |
tree | 586958dc0f4d60d96f50d9a30ebfcc20b88f9d5a /eval_intern.h | |
parent | dbe2b0e416d8d28d82849eb5891a398e160c10f6 (diff) | |
download | ruby-e5f3b1a5cc39db25503f1d175fbd0f93c04a85c6.tar.gz ruby-e5f3b1a5cc39db25503f1d175fbd0f93c04a85c6.tar.xz ruby-e5f3b1a5cc39db25503f1d175fbd0f93c04a85c6.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@12395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r-- | eval_intern.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/eval_intern.h b/eval_intern.h index 2bc529db9..157e7a58b 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -117,6 +117,14 @@ char *strrchr _((const char *, const char)); #include <sys/stat.h> +#define SAVE_ROOT_JMPBUF(th, stmt) do \ + if (ruby_setjmp((th)->root_jmpbuf) == 0) { \ + stmt; \ + } \ + else { \ + rb_fiber_start(th); \ + } while (0) + #define TH_PUSH_TAG(th) do { \ rb_thread_t * const _th = th; \ struct rb_vm_tag _tag; \ |