cleanup more synchronization code

This commit is contained in:
Nguyen Anh Quynh
2017-01-09 14:05:39 +08:00
parent d7ead1135d
commit 52cb0ba78e
13 changed files with 0 additions and 279 deletions

View File

@@ -90,16 +90,13 @@ int qemu_init_vcpu(CPUState *cpu)
return 0;
}
static void *qemu_tcg_cpu_loop(struct uc_struct *uc)
{
CPUState *cpu = uc->cpu;
//qemu_tcg_init_cpu_signals();
qemu_mutex_lock(&uc->qemu_global_mutex);
cpu->created = true;
qemu_cond_signal(&uc->qemu_cpu_cond);
while (1) {
if (tcg_exec_all(uc))
@@ -107,29 +104,14 @@ static void *qemu_tcg_cpu_loop(struct uc_struct *uc)
}
cpu->created = false;
qemu_cond_destroy(cpu->halt_cond);
g_free(cpu->halt_cond);
cpu->halt_cond = NULL;
qemu_mutex_unlock(&uc->qemu_global_mutex);
return NULL;
}
static int qemu_tcg_init_vcpu(CPUState *cpu)
{
struct uc_struct *uc = cpu->uc;
tcg_cpu_address_space_init(cpu, cpu->as);
/* share a single thread for all cpus with TCG */
if (!cpu->halt_cond) {
cpu->halt_cond = g_malloc0(sizeof(QemuCond));
qemu_cond_init(cpu->halt_cond);
}
uc->tcg_halt_cond = cpu->halt_cond;
return 0;
}