[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH-for-8.0] coroutine: Add missing <qemu/atomic.h> include

From: Philippe Mathieu-Daudé
Subject: [PATCH-for-8.0] coroutine: Add missing <qemu/atomic.h> include
Date: Fri, 25 Nov 2022 18:55:32 +0100

qemu_co_mutex_assert_locked() calls qatomic_read(), which
is declared in <qemu/atomic.h>. This fixes when refactoring:

  In file included from include/qemu/osdep.h:113,
                   from ../../util/error-report.c:13:
  include/qemu/coroutine.h: In function 'qemu_co_mutex_assert_locked':
  include/qemu/coroutine.h:182:12: error: implicit declaration of function 
'qatomic_read' [-Werror=implicit-function-declaration]
    182 |     assert(qatomic_read(&mutex->locked) &&
        |            ^~~~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
 include/qemu/coroutine.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index 89650a2d7f..1750c30d8e 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -17,6 +17,7 @@
 #include "qemu/queue.h"
 #include "qemu/timer.h"
+#include "qemu/atomic.h"
  * Coroutines are a mechanism for stack switching and can be used for

reply via email to

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