From patchwork Tue Jan 26 16:00:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/5] fix locking error with current_tb From: Riku Voipio X-Patchwork-Id: 43712 Message-Id: <1264521604-2020-3-git-send-email-riku.voipio@iki.fi> To: qemu-devel@nongnu.org Cc: Riku Voipio Date: Tue, 26 Jan 2010 16:00:01 +0000 From: Riku Voipio Signed-off-by: Riku Voipio --- exec.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 1190591..71f655f 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 */