aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@nokia.com>2010-01-20 12:56:27 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-02-06 17:19:43 +0100
commitcab1b4bdc7d42759e0487e73cc19946e77c82a3a (patch)
treea28b62bd88b27e60cc8b9e954a85e4b6f14a7ced /exec.c
parentda79030f47788d755031e0903be14bb5559eac94 (diff)
downloadqemu-cab1b4bdc7d42759e0487e73cc19946e77c82a3a.zip
qemu-cab1b4bdc7d42759e0487e73cc19946e77c82a3a.tar.gz
qemu-cab1b4bdc7d42759e0487e73cc19946e77c82a3a.tar.bz2
fix locking error with current_tb
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/exec.c b/exec.c
index b2a1cf1..461bbff 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 */