mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
CoQueue: introduce qemu_co_queue_wait_insert_head
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
@@ -61,6 +61,14 @@ void coroutine_fn qemu_co_queue_wait(CoQueue *queue)
|
||||
assert(qemu_in_coroutine());
|
||||
}
|
||||
|
||||
void coroutine_fn qemu_co_queue_wait_insert_head(CoQueue *queue)
|
||||
{
|
||||
Coroutine *self = qemu_coroutine_self();
|
||||
QTAILQ_INSERT_HEAD(&queue->entries, self, co_queue_next);
|
||||
qemu_coroutine_yield();
|
||||
assert(qemu_in_coroutine());
|
||||
}
|
||||
|
||||
bool qemu_co_queue_next(CoQueue *queue)
|
||||
{
|
||||
Coroutine *next;
|
||||
|
||||
Reference in New Issue
Block a user