From 96240c6d2d09bb186ebfba2f414348663b806010 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 12 Mar 2008 05:47:10 +0000 Subject: * eval_intern.h (rb_thread_raised_set): use generic flags. * eval.c (rb_longjmp): clear all raised flags. * eval.c (stack_check): leave clearing flag to rb_longjmp. * gc.c (rb_memerror): use thread raised flag instead of static flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval_intern.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'eval_intern.h') diff --git a/eval_intern.h b/eval_intern.h index b5133f0460..0c50331b3e 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -195,16 +195,17 @@ while (0) void rb_thread_cleanup(void); void rb_thread_wait_other_threads(void); -#define RAISED_EXCEPTION 1 -#define RAISED_STACKOVERFLOW 2 +enum { + RAISED_EXCEPTION = 1, + RAISED_STACKOVERFLOW, + RAISED_NOMEMORY, +}; int rb_thread_set_raised(rb_thread_t *th); int rb_thread_reset_raised(rb_thread_t *th); -#define rb_thread_set_stack_overflow(th) \ - ((th)->raised_flag |= RAISED_STACKOVERFLOW) -#define rb_thread_reset_stack_overflow(th) \ - ((th)->raised_flag &= ~RAISED_STACKOVERFLOW) -#define rb_thread_stack_overflowing_p(th) \ - (((th)->raised_flag & RAISED_STACKOVERFLOW) != 0) +#define rb_thread_raised_set(th, f) ((th)->raised_flag |= (f)) +#define rb_thread_raised_reset(th, f) ((th)->raised_flag &= ~(f)) +#define rb_thread_raised_p(th, f) (((th)->raised_flag & (f)) != 0) +#define rb_thread_raised_clear(th) ((th)->raised_flag = 0) VALUE rb_f_eval(int argc, VALUE *argv, VALUE self); VALUE rb_make_exception(int argc, VALUE *argv); -- cgit v1.2.3