@@ -199,14 +199,14 @@ void qemu_co_rwlock_init(CoRwlock *lock);
* of a parallel writer, control is transferred to the caller of the current
* coroutine.
*/
-void qemu_co_rwlock_rdlock(CoRwlock *lock);
+void coroutine_fn qemu_co_rwlock_rdlock(CoRwlock *lock);
/**
* Write Locks the mutex. If the lock cannot be taken immediately because
* of a parallel reader, control is transferred to the caller of the current
* coroutine.
*/
-void qemu_co_rwlock_wrlock(CoRwlock *lock);
+void coroutine_fn qemu_co_rwlock_wrlock(CoRwlock *lock);
/**
* Unlocks the read/write lock and schedules the next coroutine that was
@@ -161,7 +161,7 @@ void qemu_co_rwlock_init(CoRwlock *lock)
qemu_co_queue_init(&lock->queue);
}
-void qemu_co_rwlock_rdlock(CoRwlock *lock)
+void coroutine_fn qemu_co_rwlock_rdlock(CoRwlock *lock)
{
while (lock->writer) {
qemu_co_queue_wait(&lock->queue);
@@ -185,7 +185,7 @@ void qemu_co_rwlock_unlock(CoRwlock *lock)
}
}
-void qemu_co_rwlock_wrlock(CoRwlock *lock)
+void coroutine_fn qemu_co_rwlock_wrlock(CoRwlock *lock)
{
while (lock->writer || lock->reader) {
qemu_co_queue_wait(&lock->queue);
qemu_co_rwlock_rdlock and qemu_co_rwlock_wrlock can only run in a coroutine context, so annotate them with coroutine_fn. Signed-off-by: Charlie Shepherd <charlie@ctshepherd.com> --- include/block/coroutine.h | 4 ++-- qemu-coroutine-lock.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)