mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
async: remove unnecessary inc/dec pairs
Pull the increment/decrement pair out of aio_bh_poll and into the callers. 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-18-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
a153bf52b3
commit
bd451435c0
3 changed files with 13 additions and 15 deletions
|
@ -425,9 +425,8 @@ static bool aio_dispatch_handlers(AioContext *ctx)
|
|||
|
||||
void aio_dispatch(AioContext *ctx)
|
||||
{
|
||||
aio_bh_poll(ctx);
|
||||
|
||||
qemu_lockcnt_inc(&ctx->list_lock);
|
||||
aio_bh_poll(ctx);
|
||||
aio_dispatch_handlers(ctx);
|
||||
qemu_lockcnt_dec(&ctx->list_lock);
|
||||
|
||||
|
@ -679,16 +678,15 @@ bool aio_poll(AioContext *ctx, bool blocking)
|
|||
}
|
||||
|
||||
npfd = 0;
|
||||
qemu_lockcnt_dec(&ctx->list_lock);
|
||||
|
||||
progress |= aio_bh_poll(ctx);
|
||||
|
||||
if (ret > 0) {
|
||||
qemu_lockcnt_inc(&ctx->list_lock);
|
||||
progress |= aio_dispatch_handlers(ctx);
|
||||
qemu_lockcnt_dec(&ctx->list_lock);
|
||||
}
|
||||
|
||||
qemu_lockcnt_dec(&ctx->list_lock);
|
||||
|
||||
progress |= timerlistgroup_run_timers(&ctx->tlg);
|
||||
|
||||
return progress;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue