qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 09/13] accel/all: Extract common_vcpu_thread_create()


From: Richard Henderson
Subject: Re: [PATCH v4 09/13] accel/all: Extract common_vcpu_thread_create()
Date: Wed, 23 Mar 2022 15:15:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 3/23/22 10:17, Philippe Mathieu-Daudé wrote:
+void rr_create_vcpu_thread_postcheck(CPUState *cpu)
  {
-    char thread_name[VCPU_THREAD_NAME_SIZE];
      static QemuCond *single_tcg_halt_cond;
-    static QemuThread *single_tcg_cpu_thread;
-
-    if (!single_tcg_cpu_thread) {
-        cpu->thread = g_new0(QemuThread, 1);
-        cpu->halt_cond = g_new0(QemuCond, 1);
-        qemu_cond_init(cpu->halt_cond);
-
-        /* share a single thread for all cpus with TCG */
-        snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "ALL CPUs/TCG");
-        qemu_thread_create(cpu->thread, thread_name,
-                           rr_cpu_thread_fn,
-                           cpu, QEMU_THREAD_JOINABLE);
+ if (! single_tcg_cpu_thread) {
          single_tcg_halt_cond = cpu->halt_cond;
          single_tcg_cpu_thread = cpu->thread;
-#ifdef _WIN32
-        cpu->hThread = qemu_thread_get_handle(cpu->thread);
-#endif
      } else {
          /* we share the thread */
          cpu->thread = single_tcg_cpu_thread;

This doesn't treat cpu->halt_cond correctly for other than the first cpu.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]