summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-01 03:56:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-01 03:56:39 +0000
commit8086b525acc199123250bc0782160ba137986e79 (patch)
treed8724adaadb75133e2a577c47a1d486540eb3453 /thread.c
parent3121057559fa8848c734c6dc270b3ff4a1c370a2 (diff)
* thread.c (ruby_suppress_tracing): restore the state and invoke
the func with normal state. a patch from Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:42162]. [ruby-core:31783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 6c783c9dc9..4063fd8dba 100644
--- a/thread.c
+++ b/thread.c
@@ -4099,6 +4099,7 @@ ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always)
rb_thread_t *th = GET_THREAD();
int state, tracing;
volatile int raised;
+ volatile int outer_state;
VALUE result = Qnil;
if ((tracing = th->tracing) != 0 && !always) {
@@ -4109,6 +4110,8 @@ ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always)
}
raised = rb_threadptr_reset_raised(th);
+ outer_state = th->state;
+ th->state = 0;
PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {
@@ -4124,6 +4127,7 @@ ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always)
if (state) {
JUMP_TAG(state);
}
+ th->state = outer_state;
return result;
}