summaryrefslogtreecommitdiff
path: root/eval_intern.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-27 19:12:43 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-27 19:12:43 +0000
commit57062d91b9bfb1688151cd2393011504fd26f0d8 (patch)
tree586958dc0f4d60d96f50d9a30ebfcc20b88f9d5a /eval_intern.h
parentb69b1af65002e9a70a4f33bafa35593b4618e7a4 (diff)
* 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 'eval_intern.h')
-rw-r--r--eval_intern.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/eval_intern.h b/eval_intern.h
index 2bc529db93..157e7a58bd 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; \