From: Riku Voipio Date: Wed, 20 Jan 2010 10:56:27 +0000 (+0200) Subject: fix locking error with current_tb X-Git-Tag: qemu-xen-4.2.0~3959 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cab1b4bdc7d42759e0487e73cc19946e77c82a3a;p=qemu-xen.git fix locking error with current_tb Signed-off-by: Riku Voipio --- diff --git a/exec.c b/exec.c index b2a1cf14a8..461bbffa68 100644 --- a/exec.c +++ b/exec.c @@ -1537,15 +1537,15 @@ static void cpu_unlink_tb(CPUState *env) TranslationBlock *tb; static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED; + spin_lock(&interrupt_lock); tb = env->current_tb; /* if the cpu is currently executing code, we must unlink it and all the potentially executing TB */ if (tb) { - spin_lock(&interrupt_lock); env->current_tb = NULL; tb_reset_jump_recursive(tb); - spin_unlock(&interrupt_lock); } + spin_unlock(&interrupt_lock); } /* mask must never be zero, except for A20 change call */