diff options
author | Fam Zheng <famz@redhat.com> | 2017-04-10 20:07:35 +0800 |
---|---|---|
committer | Fam Zheng <famz@redhat.com> | 2017-04-11 20:07:15 +0800 |
commit | 8865852e00557925f60eb6e26d797833422ee86d (patch) | |
tree | 3f4da272ed71d60b9b248716a7c9b328e2237c38 /util | |
parent | ba9e75ceef93000e624ae55faf2e498f96be2ec7 (diff) | |
download | qemu-8865852e00557925f60eb6e26d797833422ee86d.zip |
async: Introduce aio_co_enter
They start the coroutine on the specified context.
Signed-off-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/async.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/util/async.c b/util/async.c index 663e297e1f..355af73ee7 100644 --- a/util/async.c +++ b/util/async.c @@ -453,6 +453,11 @@ void aio_co_wake(struct Coroutine *co) smp_read_barrier_depends(); ctx = atomic_read(&co->ctx); + aio_co_enter(ctx, co); +} + +void aio_co_enter(AioContext *ctx, struct Coroutine *co) +{ if (ctx != qemu_get_current_aio_context()) { aio_co_schedule(ctx, co); return; @@ -464,7 +469,7 @@ void aio_co_wake(struct Coroutine *co) QSIMPLEQ_INSERT_TAIL(&self->co_queue_wakeup, co, co_queue_next); } else { aio_context_acquire(ctx); - qemu_coroutine_enter(co); + qemu_aio_coroutine_enter(ctx, co); aio_context_release(ctx); } } |