mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
coroutine: add co_aio_sleep_ns() to allow sleep in block drivers
This helper function behaves similarly to co_sleep_ns(), but the sleeping coroutine will be resumed when using qemu_aio_wait(). Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Tested-by: Liu Yuan <namei.unix@gmail.com> Reviewed-by: Liu Yuan <namei.unix@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
72e0996c41
commit
3ab7bd1917
2 changed files with 23 additions and 0 deletions
|
@ -215,6 +215,15 @@ void qemu_co_rwlock_unlock(CoRwlock *lock);
|
|||
*/
|
||||
void coroutine_fn co_sleep_ns(QEMUClockType type, int64_t ns);
|
||||
|
||||
/**
|
||||
* Yield the coroutine for a given duration
|
||||
*
|
||||
* Behaves similarly to co_sleep_ns(), but the sleeping coroutine will be
|
||||
* resumed when using qemu_aio_wait().
|
||||
*/
|
||||
void coroutine_fn co_aio_sleep_ns(AioContext *ctx, QEMUClockType type,
|
||||
int64_t ns);
|
||||
|
||||
/**
|
||||
* Yield until a file descriptor becomes readable
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue