From e9e6295b28b331762e67d466f77ba07a349edbbc Mon Sep 17 00:00:00 2001 From: Zhi Yong Wu Date: Thu, 3 Nov 2011 16:57:26 +0800 Subject: CoQueue: introduce qemu_co_queue_wait_insert_head Signed-off-by: Zhi Yong Wu Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qemu-coroutine-lock.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qemu-coroutine-lock.c') diff --git a/qemu-coroutine-lock.c b/qemu-coroutine-lock.c index 6b58160058..9549c075ee 100644 --- a/qemu-coroutine-lock.c +++ b/qemu-coroutine-lock.c @@ -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; -- cgit v1.2.3