[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/35] coroutine: introduce coroutine_only_fn
From: |
Paolo Bonzini |
Subject: |
[PATCH 04/35] coroutine: introduce coroutine_only_fn |
Date: |
Thu, 10 Mar 2022 13:43:42 +0100 |
Some functions only make sense from coroutine context, but never yield.
Mark them as "coroutine_only_fn".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/qemu/coroutine.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index 6f4596fc5b..b23fba88c2 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -43,6 +43,7 @@
* }
*/
#define coroutine_fn
+#define coroutine_only_fn
typedef struct Coroutine Coroutine;
@@ -97,7 +98,7 @@ AioContext *qemu_coroutine_get_aio_context(Coroutine *co);
/**
* Get the currently executing coroutine
*/
-Coroutine *coroutine_fn qemu_coroutine_self(void);
+Coroutine *coroutine_only_fn qemu_coroutine_self(void);
/**
* Return whether or not currently inside a coroutine
@@ -170,7 +171,7 @@ void coroutine_fn qemu_co_mutex_unlock(CoMutex *mutex);
/**
* Assert that the current coroutine holds @mutex.
*/
-static inline coroutine_fn void qemu_co_mutex_assert_locked(CoMutex *mutex)
+static inline void coroutine_only_fn qemu_co_mutex_assert_locked(CoMutex
*mutex)
{
/*
* mutex->holder doesn't need any synchronisation if the assertion holds
--
2.35.1
- [PATCH 05/35] coroutine: small code cleanup in qemu_co_rwlock_wrlock, (continued)
- [PATCH 05/35] coroutine: small code cleanup in qemu_co_rwlock_wrlock, Paolo Bonzini, 2022/03/10
- [PATCH 08/35] /basic/lifecycle, Paolo Bonzini, 2022/03/10
- [PATCH 01/35] coroutine: add missing coroutine_fn annotations for CoRwlock functions, Paolo Bonzini, 2022/03/10
- [PATCH 09/35] convert qemu-coroutine-sleep.c to stackless coroutines, Paolo Bonzini, 2022/03/10
- [PATCH 14/35] /basic/nesting, Paolo Bonzini, 2022/03/10
- [PATCH 03/35] coroutine: introduce QemuCoLockable, Paolo Bonzini, 2022/03/10
- [PATCH 07/35] coroutine: introduce the "stackless coroutine" backend, Paolo Bonzini, 2022/03/10
- [PATCH 16/35] /basic/entered, Paolo Bonzini, 2022/03/10
- [PATCH 17/35] /basic/in_coroutine, Paolo Bonzini, 2022/03/10
- [PATCH 04/35] coroutine: introduce coroutine_only_fn,
Paolo Bonzini <=
- [PATCH 06/35] disable some code, Paolo Bonzini, 2022/03/10
- [PATCH 21/35] /perf/yield, Paolo Bonzini, 2022/03/10
- [PATCH 26/35] convert qemu_co_mutex_lock_slowpath to magic macros, Paolo Bonzini, 2022/03/10
- [PATCH 11/35] convert CoMutex to stackless coroutines, Paolo Bonzini, 2022/03/10
- [PATCH 13/35] /basic/yield, Paolo Bonzini, 2022/03/10
- [PATCH 10/35] enable tail call optimization of qemu_co_mutex_lock, Paolo Bonzini, 2022/03/10
- [PATCH 20/35] /perf/nesting, Paolo Bonzini, 2022/03/10
- [PATCH 18/35] /basic/order, Paolo Bonzini, 2022/03/10
- [PATCH 27/35] /locking/co-mutex/lockable, Paolo Bonzini, 2022/03/10
- [PATCH 23/35] /perf/cost, Paolo Bonzini, 2022/03/10