]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qemu-thread: Document QemuEvent
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Thu, 29 May 2025 05:46:01 +0000 (14:46 +0900)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 6 Jun 2025 12:32:55 +0000 (14:32 +0200)
Document QemuEvent to help choose an appropriate synchronization
primitive.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Link: https://lore.kernel.org/r/20250529-event-v5-12-53b285203794@daynix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/qemu/thread.h

index 573f8c9ede20e9dbbfb089561fa5a99adceb8efa..f0302ed01fdbfbc1250290b6519360530fd0b4f8 100644 (file)
@@ -10,6 +10,16 @@ typedef struct QemuSemaphore QemuSemaphore;
 typedef struct QemuLockCnt QemuLockCnt;
 typedef struct QemuThread QemuThread;
 
+/*
+ * QemuEvent
+ * =========
+ *
+ * QemuEvent is an implementation of Win32 manual-reset event object.
+ * For details, refer to:
+ * https://learn.microsoft.com/en-us/windows/win32/sync/using-event-objects
+ *
+ * QemuEvent is more lightweight than QemuSemaphore when HAVE_FUTEX is defined.
+ */
 typedef struct QemuEvent {
 #ifndef HAVE_FUTEX
     pthread_mutex_t lock;