diff options
Diffstat (limited to 'system/cpu-throttle.c')
| -rw-r--r-- | system/cpu-throttle.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/cpu-throttle.c b/system/cpu-throttle.c index d9bb30a223..c951a6c65e 100644 --- a/system/cpu-throttle.c +++ b/system/cpu-throttle.c @@ -54,12 +54,12 @@ static void cpu_throttle_thread(CPUState *cpu, run_on_cpu_data opaque) endtime_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME) + sleeptime_ns; while (sleeptime_ns > 0 && !cpu->stop) { if (sleeptime_ns > SCALE_MS) { - qemu_cond_timedwait_iothread(cpu->halt_cond, + qemu_cond_timedwait_bql(cpu->halt_cond, sleeptime_ns / SCALE_MS); } else { - qemu_mutex_unlock_iothread(); + bql_unlock(); g_usleep(sleeptime_ns / SCALE_US); - qemu_mutex_lock_iothread(); + bql_lock(); } sleeptime_ns = endtime_ns - qemu_clock_get_ns(QEMU_CLOCK_REALTIME); } |