mirror of https://github.com/xqemu/xqemu.git
fix locking error with current_tb
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
This commit is contained in:
parent
c4ab7899f2
commit
26bc95a037
4
exec.c
4
exec.c
|
@ -1537,15 +1537,15 @@ static void cpu_unlink_tb(CPUState *env)
|
||||||
TranslationBlock *tb;
|
TranslationBlock *tb;
|
||||||
static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED;
|
static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED;
|
||||||
|
|
||||||
|
spin_lock(&interrupt_lock);
|
||||||
tb = env->current_tb;
|
tb = env->current_tb;
|
||||||
/* if the cpu is currently executing code, we must unlink it and
|
/* if the cpu is currently executing code, we must unlink it and
|
||||||
all the potentially executing TB */
|
all the potentially executing TB */
|
||||||
if (tb) {
|
if (tb) {
|
||||||
spin_lock(&interrupt_lock);
|
|
||||||
env->current_tb = NULL;
|
env->current_tb = NULL;
|
||||||
tb_reset_jump_recursive(tb);
|
tb_reset_jump_recursive(tb);
|
||||||
spin_unlock(&interrupt_lock);
|
|
||||||
}
|
}
|
||||||
|
spin_unlock(&interrupt_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mask must never be zero, except for A20 change call */
|
/* mask must never be zero, except for A20 change call */
|
||||||
|
|
Loading…
Reference in New Issue