mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
io: Add qio_channel_wait_cond() helper
Add the helper to wait for QIO channel's IO availability in any context (coroutine, or non-coroutine). Use it tree-wide for three occurences. Cc: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Link: https://lore.kernel.org/r/20251022192612.2737648-2-peterx@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
@@ -871,6 +871,21 @@ void qio_channel_wake_read(QIOChannel *ioc);
|
||||
void qio_channel_wait(QIOChannel *ioc,
|
||||
GIOCondition condition);
|
||||
|
||||
/**
|
||||
* qio_channel_wait_cond:
|
||||
* @ioc: the channel object
|
||||
* @condition: the I/O condition to wait for
|
||||
*
|
||||
* Block execution from the current thread until
|
||||
* the condition indicated by @condition becomes
|
||||
* available.
|
||||
*
|
||||
* This will work with/without a coroutine context, by automatically select
|
||||
* the proper API to wait.
|
||||
*/
|
||||
void qio_channel_wait_cond(QIOChannel *ioc,
|
||||
GIOCondition condition);
|
||||
|
||||
/**
|
||||
* qio_channel_set_aio_fd_handler:
|
||||
* @ioc: the channel object
|
||||
|
||||
Reference in New Issue
Block a user