From 687dfb2ac2c9768b2cb05ad8a0653aebb31eb23a Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 22 Dec 2003 09:37:13 +0000 Subject: * eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead of ALLOW_INTS which may switch context. [ruby-dev:22319] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 545d678be..8d19602c4 100644 --- a/eval.c +++ b/eval.c @@ -4733,14 +4733,18 @@ rb_with_disable_interrupt(proc, data) int status; DEFER_INTS; - RUBY_CRITICAL( + { + int thr_critical = rb_thread_critical; + + rb_thread_critical = Qtrue; PUSH_TAG(PROT_NONE); if ((status = EXEC_TAG()) == 0) { result = (*proc)(data); } POP_TAG(); - ); - ALLOW_INTS; + rb_thread_critical = thr_critical; + } + ENABLE_INTS; if (status) JUMP_TAG(status); return result; -- cgit