static void qemu_tcg_init_vcpu(CPUState *cpu)

{

    char thread_name[VCPU_THREAD_NAME_SIZE];

    static QemuCond *tcg_halt_cond;

    static QemuThread *tcg_cpu_thread;



    tcg_cpu_address_space_init(cpu, cpu->as);



    /* share a single thread for all cpus with TCG */

    if (!tcg_cpu_thread) {

        cpu->thread = g_malloc0(sizeof(QemuThread));

        cpu->halt_cond = g_malloc0(sizeof(QemuCond));

        qemu_cond_init(cpu->halt_cond);

        tcg_halt_cond = cpu->halt_cond;

        snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG",

                 cpu->cpu_index);

        qemu_thread_create(cpu->thread, thread_name, qemu_tcg_cpu_thread_fn,

                           cpu, QEMU_THREAD_JOINABLE);

#ifdef _WIN32

        cpu->hThread = qemu_thread_get_handle(cpu->thread);

#endif

        while (!cpu->created) {

            qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);

        }

        tcg_cpu_thread = cpu->thread;

    } else {

        cpu->thread = tcg_cpu_thread;

        cpu->halt_cond = tcg_halt_cond;

    }

}

static void qemu_tcg_init_vcpu(CPUState *cpu)

{

    char thread_name[VCPU_THREAD_NAME_SIZE];

    static QemuCond *tcg_halt_cond;

    static QemuThread *tcg_cpu_thread;



    tcg_cpu_address_space_init(cpu, cpu->as);



    

    if (!tcg_cpu_thread) {

        cpu->thread = g_malloc0(sizeof(QemuThread));

        cpu->halt_cond = g_malloc0(sizeof(QemuCond));

        qemu_cond_init(cpu->halt_cond);

        tcg_halt_cond = cpu->halt_cond;

        snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG",

                 cpu->cpu_index);

        qemu_thread_create(cpu->thread, thread_name, qemu_tcg_cpu_thread_fn,

                           cpu, QEMU_THREAD_JOINABLE);

#ifdef _WIN32

        cpu->hThread = qemu_thread_get_handle(cpu->thread);

#endif

        while (!cpu->created) {

            qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);

        }

        tcg_cpu_thread = cpu->thread;

    } else {

        cpu->thread = tcg_cpu_thread;

        cpu->halt_cond = tcg_halt_cond;

    }

}

static void FUNC_0(CPUState *VAR_0)

{

    char VAR_1[VCPU_THREAD_NAME_SIZE];

    static QemuCond *VAR_2;

    static QemuThread *VAR_3;



    tcg_cpu_address_space_init(VAR_0, VAR_0->as);



    

    if (!VAR_3) {

        VAR_0->thread = g_malloc0(sizeof(QemuThread));

        VAR_0->halt_cond = g_malloc0(sizeof(QemuCond));

        qemu_cond_init(VAR_0->halt_cond);

        VAR_2 = VAR_0->halt_cond;

        snprintf(VAR_1, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG",

                 VAR_0->cpu_index);

        qemu_thread_create(VAR_0->thread, VAR_1, qemu_tcg_cpu_thread_fn,

                           VAR_0, QEMU_THREAD_JOINABLE);

#ifdef _WIN32

        VAR_0->hThread = qemu_thread_get_handle(VAR_0->thread);

#endif

        while (!VAR_0->created) {

            qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);

        }

        VAR_3 = VAR_0->thread;

    } else {

        VAR_0->thread = VAR_3;

        VAR_0->halt_cond = VAR_2;

    }

}

static void FUNC_0(CPUState *VAR_0)
{ char VAR_1[VCPU_THREAD_NAME_SIZE]; static QemuCond *VAR_2; static QemuThread *VAR_3; tcg_cpu_address_space_init(VAR_0, VAR_0->as); if (!VAR_3) { VAR_0->thread = g_malloc0(sizeof(QemuThread)); VAR_0->halt_cond = g_malloc0(sizeof(QemuCond)); qemu_cond_init(VAR_0->halt_cond); VAR_2 = VAR_0->halt_cond; snprintf(VAR_1, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG",
VAR_0->cpu_index); qemu_thread_create(VAR_0->thread, VAR_1, qemu_tcg_cpu_thread_fn,
VAR_0, QEMU_THREAD_JOINABLE); #ifdef _WIN32
VAR_0->hThread = qemu_thread_get_handle(VAR_0->thread); #endif
while (!VAR_0->created) { qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); } VAR_3 = VAR_0->thread; } else { VAR_0->thread = VAR_3; VAR_0->halt_cond = VAR_2; } }