diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-04 19:09:59 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-07-13 13:26:02 +0200 |
commit | 7d9c8581370738fb3877a724ac061e6a8cd00121 (patch) | |
tree | 9d3a8a6c126d03457189166249eb8e077845157f /include | |
parent | 5af7045bd0d45cff5c8eb0a3b14b900d9bd24998 (diff) |
coroutine: use QSIMPLEQ instead of QTAILQ
CoQueue do not need to remove any element but the head of the list;
processing is always strictly FIFO. Therefore, the simpler singly-linked
QSIMPLEQ can be used instead.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/coroutine.h | 2 | ||||
-rw-r--r-- | include/qemu/coroutine_int.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index 305fe76c29..63ae7fee75 100644 --- a/include/qemu/coroutine.h +++ b/include/qemu/coroutine.h @@ -102,7 +102,7 @@ bool qemu_in_coroutine(void); * are built. */ typedef struct CoQueue { - QTAILQ_HEAD(, Coroutine) entries; + QSIMPLEQ_HEAD(, Coroutine) entries; } CoQueue; /** diff --git a/include/qemu/coroutine_int.h b/include/qemu/coroutine_int.h index 42d6838401..581a7f5140 100644 --- a/include/qemu/coroutine_int.h +++ b/include/qemu/coroutine_int.h @@ -41,8 +41,8 @@ struct Coroutine { QSLIST_ENTRY(Coroutine) pool_next; /* Coroutines that should be woken up when we yield or terminate */ - QTAILQ_HEAD(, Coroutine) co_queue_wakeup; - QTAILQ_ENTRY(Coroutine) co_queue_next; + QSIMPLEQ_HEAD(, Coroutine) co_queue_wakeup; + QSIMPLEQ_ENTRY(Coroutine) co_queue_next; }; Coroutine *qemu_coroutine_new(void); |