summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 04:52:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-28 04:52:01 +0000
commitecd35c0d9692704c7c1298ef9d38a73687d383fb (patch)
tree948dd927a352dd090f34ea7ff932930c4a15b2ec /eval.c
parent5848032ce5784083e230c608b3b63d9072fa40f8 (diff)
* eval.c (stack_check): made flag per threads.
* thread.c (rb_thread_set_raised, rb_thread_reset_raised): prefixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index db760116df..cd65803273 100644
--- a/eval.c
+++ b/eval.c
@@ -656,7 +656,7 @@ rb_longjmp(int tag, VALUE mesg)
const char *file;
int line = 0;
- if (thread_set_raised(th)) {
+ if (rb_thread_set_raised(th)) {
th->errinfo = exception_error;
JUMP_TAG(TAG_FATAL);
}
@@ -703,7 +703,7 @@ rb_longjmp(int tag, VALUE mesg)
th->errinfo = mesg;
}
else if (status) {
- thread_reset_raised(th);
+ rb_thread_reset_raised(th);
JUMP_TAG(status);
}
}
@@ -715,7 +715,7 @@ rb_longjmp(int tag, VALUE mesg)
0 /* TODO: id */, 0 /* TODO: klass */);
}
- thread_reset_raised(th);
+ rb_thread_reset_raised(th);
JUMP_TAG(tag);
}
@@ -1241,17 +1241,17 @@ rb_with_disable_interrupt(VALUE (*proc)(ANYARGS), VALUE data)
static inline void
stack_check(void)
{
- static int overflowing = 0;
+ rb_thread_t *th = GET_THREAD();
- if (!overflowing && ruby_stack_check()) {
+ if (!rb_thread_stack_overflowing_p(th) && ruby_stack_check()) {
int state;
- overflowing = 1;
+ rb_thread_set_stack_overflow(th);
PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {
rb_exc_raise(sysstack_error);
}
POP_TAG();
- overflowing = 0;
+ rb_thread_reset_stack_overflow(th);
JUMP_TAG(state);
}
}
@@ -1427,6 +1427,8 @@ rb_call0(VALUE klass, VALUE recv, ID mid, int argc, const VALUE *argv, int scope
}
}
+ stack_check();
+
{
VALUE val;
/*