diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-12-13 13:43:52 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-15 09:20:50 -0600 |
commit | 1ecf47bf0a091700e45f1b7d1f5ad85abc0acd22 (patch) | |
tree | 879b0b0ebaba1097b246fe60f590fa8028d12bea /cpus.c | |
parent | cd34d667d448bec91c81f4e46f9e7eb4e4857f6f (diff) | |
download | qemu-1ecf47bf0a091700e45f1b7d1f5ad85abc0acd22.zip qemu-1ecf47bf0a091700e45f1b7d1f5ad85abc0acd22.tar.gz qemu-1ecf47bf0a091700e45f1b7d1f5ad85abc0acd22.tar.bz2 |
fix win32 build
On Windows, cpus.c needs access to the hThread. Add a Windows-specific
function to grab it. This requires changing the CPU threads to
joinable. There is no substantial change because the threads run
in an infinite loop.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'cpus.c')
-rw-r--r-- | cpus.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -793,9 +793,9 @@ static void qemu_cpu_kick_thread(CPUState *env) } #else /* _WIN32 */ if (!qemu_cpu_is_self(env)) { - SuspendThread(env->thread->thread); + SuspendThread(env->hThread); cpu_signal(0); - ResumeThread(env->thread->thread); + ResumeThread(env->hThread); } #endif } @@ -911,7 +911,10 @@ static void qemu_tcg_init_vcpu(void *_env) qemu_cond_init(env->halt_cond); tcg_halt_cond = env->halt_cond; qemu_thread_create(env->thread, qemu_tcg_cpu_thread_fn, env, - QEMU_THREAD_DETACHED); + QEMU_THREAD_JOINABLE); +#ifdef _WIN32 + env->hThread = qemu_thread_get_handle(env->thread); +#endif while (env->created == 0) { qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); } @@ -928,7 +931,7 @@ static void qemu_kvm_start_vcpu(CPUState *env) env->halt_cond = g_malloc0(sizeof(QemuCond)); qemu_cond_init(env->halt_cond); qemu_thread_create(env->thread, qemu_kvm_cpu_thread_fn, env, - QEMU_THREAD_DETACHED); + QEMU_THREAD_JOINABLE); while (env->created == 0) { qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); } |