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>
This commit is contained in:
Paolo Bonzini
2016-07-04 19:09:59 +02:00
committed by Kevin Wolf
parent 5af7045bd0
commit 7d9c858137
4 changed files with 15 additions and 15 deletions

View File

@@ -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);