mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: explicitly acquire aiocontext in timers that need it
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170213135235.12274-13-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
0836c72f70
commit
2f47da5f7f
10 changed files with 35 additions and 7 deletions
|
@ -454,9 +454,7 @@ bool aio_dispatch(AioContext *ctx, bool dispatch_fds)
|
|||
}
|
||||
|
||||
/* Run our timers */
|
||||
aio_context_acquire(ctx);
|
||||
progress |= timerlistgroup_run_timers(&ctx->tlg);
|
||||
aio_context_release(ctx);
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
|
|
@ -403,9 +403,7 @@ bool aio_poll(AioContext *ctx, bool blocking)
|
|||
progress |= aio_dispatch_handlers(ctx, event);
|
||||
} while (count > 0);
|
||||
|
||||
aio_context_acquire(ctx);
|
||||
progress |= timerlistgroup_run_timers(&ctx->tlg);
|
||||
aio_context_release(ctx);
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ static void co_sleep_cb(void *opaque)
|
|||
{
|
||||
CoSleepCB *sleep_cb = opaque;
|
||||
|
||||
qemu_coroutine_enter(sleep_cb->co);
|
||||
aio_co_wake(sleep_cb->co);
|
||||
}
|
||||
|
||||
void coroutine_fn co_aio_sleep_ns(AioContext *ctx, QEMUClockType type,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue