qemu-block
[Top][All Lists]
Advanced

[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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]