[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/34] Wrapper function to wait on condition for the main loop mut
From: |
David Gibson |
Subject: |
[PULL 24/34] Wrapper function to wait on condition for the main loop mutex |
Date: |
Fri, 31 Jan 2020 17:09:14 +1100 |
From: Aravinda Prasad <address@hidden>
Introduce a wrapper function to wait on condition for
the main loop mutex. This function atomically releases
the main loop mutex and causes the calling thread to
block on the condition. This wrapper is required because
qemu_global_mutex is a static variable.
Signed-off-by: Aravinda Prasad <address@hidden>
Signed-off-by: Ganesh Goudar <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
cpus.c | 5 +++++
include/qemu/main-loop.h | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/cpus.c b/cpus.c
index b612116f95..b4f8b84b61 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1839,6 +1839,11 @@ void qemu_mutex_unlock_iothread(void)
qemu_mutex_unlock(&qemu_global_mutex);
}
+void qemu_cond_wait_iothread(QemuCond *cond)
+{
+ qemu_cond_wait(cond, &qemu_global_mutex);
+}
+
static bool all_vcpus_paused(void)
{
CPUState *cpu;
diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h
index f6ba78ea73..a6d20b0719 100644
--- a/include/qemu/main-loop.h
+++ b/include/qemu/main-loop.h
@@ -295,6 +295,14 @@ void qemu_mutex_lock_iothread_impl(const char *file, int
line);
*/
void qemu_mutex_unlock_iothread(void);
+/*
+ * qemu_cond_wait_iothread: Wait on condition for the main loop mutex
+ *
+ * This function atomically releases the main loop mutex and causes
+ * the calling thread to block on the condition.
+ */
+void qemu_cond_wait_iothread(QemuCond *cond);
+
/* internal interfaces */
void qemu_fd_register(int fd);
--
2.24.1
- [PULL 05/34] target/ppc: Clarify the meaning of return values in kvm_handle_debug, (continued)
- [PULL 05/34] target/ppc: Clarify the meaning of return values in kvm_handle_debug, David Gibson, 2020/01/31
- [PULL 07/34] target/ppc: Add privileged message send facilities, David Gibson, 2020/01/31
- [PULL 09/34] spapr: Don't allow multiple active vCPUs at CAS, David Gibson, 2020/01/31
- [PULL 10/34] ppc/pnv: Add support for HRMOR on Radix host, David Gibson, 2020/01/31
- [PULL 12/34] ppc/pnv: Add support for "hostboot" mode, David Gibson, 2020/01/31
- [PULL 06/34] spapr: Fail CAS if option vector table cannot be parsed, David Gibson, 2020/01/31
- [PULL 13/34] tpm: Move tpm_tis_show_buffer to tpm_util.c, David Gibson, 2020/01/31
- [PULL 16/34] tpm_spapr: Support suspend and resume, David Gibson, 2020/01/31
- [PULL 22/34] spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine, David Gibson, 2020/01/31
- [PULL 15/34] tpm_spapr: Support TPM for ppc64 using CRQ based interface, David Gibson, 2020/01/31
- [PULL 24/34] Wrapper function to wait on condition for the main loop mutex,
David Gibson <=
- [PULL 25/34] ppc: spapr: Introduce FWNMI capability, David Gibson, 2020/01/31
- [PULL 21/34] ppc/pnv: change the PowerNV machine devices to be non user creatable, David Gibson, 2020/01/31
- [PULL 27/34] target/ppc: Build rtas error log upon an MCE, David Gibson, 2020/01/31
- [PULL 14/34] spapr: Implement get_dt_compatible() callback, David Gibson, 2020/01/31
- [PULL 17/34] hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES config, David Gibson, 2020/01/31
- [PULL 29/34] migration: Include migration support for machine check handling, David Gibson, 2020/01/31
- [PULL 23/34] target/ppc/cpu.h: Put macro parameter in parentheses, David Gibson, 2020/01/31
- [PULL 34/34] target/ppc: Use probe_write for DCBZ, David Gibson, 2020/01/31
- [PULL 31/34] target/ppc: Use probe_access for LSW, STSW, David Gibson, 2020/01/31
- [PULL 26/34] target/ppc: Handle NMI guest exit, David Gibson, 2020/01/31