summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-19 08:54:57 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-19 08:54:57 +0000
commite9e4ea981ed45edd35f177992ca2002a82283c8f (patch)
tree22b37703a6d19bf30644bc9354b071e8f8d766b7 /vm_trace.c
parent8255e83912f908a6ea50f7989ac27b8587fca2b6 (diff)
* vm_trace.c (rb_threadptr_exec_event_hooks): get rid of race
condition. [Bug #7589] [ruby-dev:46763] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_trace.c b/vm_trace.c
index 861ee0511a..9186983e28 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -291,7 +291,7 @@ rb_threadptr_exec_event_hooks(rb_trace_arg_t *targ)
int state = 0;
th->state = 0;
- th->vm->trace_running = 1;
+ th->vm->trace_running++;
th->trace_running = 1;
{
rb_hook_list_t *list;
@@ -313,7 +313,7 @@ rb_threadptr_exec_event_hooks(rb_trace_arg_t *targ)
}
terminate:
th->trace_running = 0;
- th->vm->trace_running = vm_tracing;
+ th->vm->trace_running--;
if (state) {
TH_JUMP_TAG(th, state);