[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/35] Wrapper function to wait on condition for the main loop mut
From: |
David Gibson |
Subject: |
[PULL 24/35] Wrapper function to wait on condition for the main loop mutex |
Date: |
Mon, 3 Feb 2020 17:11:12 +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 13/35] tpm: Move tpm_tis_show_buffer to tpm_util.c, (continued)
- [PULL 13/35] tpm: Move tpm_tis_show_buffer to tpm_util.c, David Gibson, 2020/02/03
- [PULL 16/35] tpm_spapr: Support suspend and resume, David Gibson, 2020/02/03
- [PULL 22/35] spapr: Enable DD2.3 accelerated count cache flush in pseries-5.0 machine, David Gibson, 2020/02/03
- [PULL 25/35] ppc: spapr: Introduce FWNMI capability, David Gibson, 2020/02/03
- [PULL 15/35] tpm_spapr: Support TPM for ppc64 using CRQ based interface, David Gibson, 2020/02/03
- [PULL 18/35] docs/specs/tpm: reST-ify TPM documentation, David Gibson, 2020/02/03
- [PULL 04/35] hw/ppc/prep: Remove the deprecated "prep" machine and the OpenHackware BIOS, David Gibson, 2020/02/03
- [PULL 20/35] ppc/pnv: Add models for POWER8 PHB3 PCIe Host bridge, David Gibson, 2020/02/03
- [PULL 23/35] target/ppc/cpu.h: Put macro parameter in parentheses, David Gibson, 2020/02/03
- [PULL 21/35] ppc/pnv: change the PowerNV machine devices to be non user creatable, David Gibson, 2020/02/03
- [PULL 24/35] Wrapper function to wait on condition for the main loop mutex,
David Gibson <=
- [PULL 27/35] target/ppc: Build rtas error log upon an MCE, David Gibson, 2020/02/03
- [PULL 30/35] ppc: spapr: Activate the FWNMI functionality, David Gibson, 2020/02/03
- [PULL 32/35] target/ppc: Use probe_access for LMW, STMW, David Gibson, 2020/02/03
- [PULL 26/35] target/ppc: Handle NMI guest exit, David Gibson, 2020/02/03
- [PULL 29/35] migration: Include migration support for machine check handling, David Gibson, 2020/02/03
- [PULL 34/35] target/ppc: Use probe_write for DCBZ, David Gibson, 2020/02/03
- [PULL 35/35] tests: Silence various warnings with pseries, David Gibson, 2020/02/03
- [PULL 28/35] ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls, David Gibson, 2020/02/03