diff mbox

[02/10] cpus: remove tcg_halt_cond global variable.

Message ID 55E156C1.7020909@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Aug. 29, 2015, 6:52 a.m. UTC
On 28/08/2015 16:36, Peter Maydell wrote:
> With this patch, code-wise tcg_halt_cond and tcg_cpu_thread
> are used in pretty much parallel ways (first call into
> qemu_tcg_init_vcpu() sets them up, all the rest just copy
> them into the CPU struct). The only difference is that one
> of them a static at file scope and the other one is a static
> at function scope. It seems a shame to not have them be
> exactly parallel...

Good point, this does the trick:

Paolo
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index 105b914..054dd68 100644
--- a/cpus.c
+++ b/cpus.c
@@ -786,8 +786,6 @@  static unsigned iothread_requesting_mutex;
 
 static QemuThread io_thread;
 
-static QemuThread *tcg_cpu_thread;
-
 /* cpu creation */
 static QemuCond qemu_cpu_cond;
 /* system init */
@@ -1222,6 +1220,7 @@  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);