[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/18] qemu-thread: Introduce QEMU_COND_INITIALIZER
From: |
Ilya Leoshkevich |
Subject: |
[PATCH 07/18] qemu-thread: Introduce QEMU_COND_INITIALIZER |
Date: |
Mon, 23 Sep 2024 18:13:02 +0200 |
Allow static initialization of condition variables.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
include/qemu/thread-posix.h | 2 ++
include/qemu/thread-win32.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/include/qemu/thread-posix.h b/include/qemu/thread-posix.h
index fc0846bfa7c..ed08181a9c6 100644
--- a/include/qemu/thread-posix.h
+++ b/include/qemu/thread-posix.h
@@ -32,6 +32,8 @@ struct QemuCond {
bool initialized;
};
+#define QEMU_COND_INITIALIZER {PTHREAD_COND_INITIALIZER, true}
+
struct QemuSemaphore {
QemuMutex mutex;
QemuCond cond;
diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h
index ed1f2d0e733..e1b014fcac4 100644
--- a/include/qemu/thread-win32.h
+++ b/include/qemu/thread-win32.h
@@ -29,6 +29,8 @@ struct QemuCond {
bool initialized;
};
+#define QEMU_COND_INITIALIZER {CONDITION_VARIABLE_INIT, true}
+
struct QemuSemaphore {
HANDLE sema;
bool initialized;
--
2.46.0
- [PATCH 16/18] cpu: Allow pausing and resuming CPUs in qemu-user, (continued)
- [PATCH 16/18] cpu: Allow pausing and resuming CPUs in qemu-user, Ilya Leoshkevich, 2024/09/23
- [PATCH 05/18] accel/tcg: Factor out cpu_exec_user(), Ilya Leoshkevich, 2024/09/23
- [PATCH 15/18] cpu: Set current_cpu early in qemu-user, Ilya Leoshkevich, 2024/09/23
- [PATCH 14/18] cpu: Introduce cpu_is_paused(), Ilya Leoshkevich, 2024/09/23
- [PATCH 12/18] cpu: Track CPUs executing syscalls, Ilya Leoshkevich, 2024/09/23
- [PATCH 01/18] gdbstub: Make gdb_get_char() static, Ilya Leoshkevich, 2024/09/23
- [PATCH 09/18] qemu-timer: Provide qemu_clock_enable() stub for qemu-user, Ilya Leoshkevich, 2024/09/23
- [PATCH 06/18] qemu-thread: Introduce QEMU_MUTEX_INITIALIZER, Ilya Leoshkevich, 2024/09/23
- [PATCH 18/18] tests/tcg: Stress test thread breakpoints, Ilya Leoshkevich, 2024/09/23
- [PATCH 13/18] cpu: Implement cpu_thread_is_idle() for qemu-user, Ilya Leoshkevich, 2024/09/23
- [PATCH 07/18] qemu-thread: Introduce QEMU_COND_INITIALIZER,
Ilya Leoshkevich <=
- [PATCH 11/18] accel/tcg: Unify user implementations of qemu_cpu_kick(), Ilya Leoshkevich, 2024/09/23
- [PATCH 17/18] gdbstub: Pause all CPUs before sending stop replies, Ilya Leoshkevich, 2024/09/23
- Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint, Ilya Leoshkevich, 2024/09/23
- Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint, Richard Henderson, 2024/09/25