From e8ee5e4c476d5b0654d8f1271a2b7c065acc486e Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 17 Nov 2011 13:40:26 +0000 Subject: coroutine: add qemu_co_queue_restart_all() It's common to wake up all waiting coroutines. Introduce the qemu_co_queue_restart_all() function to do this instead of looping over qemu_co_queue_next() in every caller. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qemu-coroutine.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qemu-coroutine.h') diff --git a/qemu-coroutine.h b/qemu-coroutine.h index 8a2e5d2a10..8a55fe125e 100644 --- a/qemu-coroutine.h +++ b/qemu-coroutine.h @@ -130,6 +130,11 @@ void coroutine_fn qemu_co_queue_wait_insert_head(CoQueue *queue); */ bool qemu_co_queue_next(CoQueue *queue); +/** + * Restarts all coroutines in the CoQueue and leaves the queue empty. + */ +void qemu_co_queue_restart_all(CoQueue *queue); + /** * Checks if the CoQueue is empty. */ -- cgit v1.2.3