summary refs log tree commit diff stats
path: root/include/qemu/lockable.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-05-02 16:32:25 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-05-03 15:47:48 +0200
commit13d110944831e8fb15087697d540d0922ea355f4 (patch)
treea139e468e4f4a51dee4eaa49559af2c8e9e6bdd0 /include/qemu/lockable.h
parenta42706dbe4f14416df5c65de1a90d72cbc338530 (diff)
downloadfocaccia-qemu-13d110944831e8fb15087697d540d0922ea355f4.tar.gz
focaccia-qemu-13d110944831e8fb15087697d540d0922ea355f4.zip
lockable: remove QemuLockable from typedefs.h
Using QemuLockable almost always requires going through QEMU_MAKE_LOCKABLE().
Therefore, there is little point in having the typedef always present.  Move
it to lockable.h, with only a small adjustment to coroutine.h (which has
a tricky co-dependency with lockable.h due to defining CoMutex *and*
using QemuLockable as a part of the CoQueue API).

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/lockable.h')
-rw-r--r--include/qemu/lockable.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/qemu/lockable.h b/include/qemu/lockable.h
index 9823220446..62110d2eb7 100644
--- a/include/qemu/lockable.h
+++ b/include/qemu/lockable.h
@@ -18,11 +18,11 @@
 
 typedef void QemuLockUnlockFunc(void *);
 
-struct QemuLockable {
+typedef struct QemuLockable {
     void *object;
     QemuLockUnlockFunc *lock;
     QemuLockUnlockFunc *unlock;
-};
+} QemuLockable;
 
 static inline __attribute__((__always_inline__)) QemuLockable *
 qemu_make_lockable(void *x, QemuLockable *lockable)