diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-02-13 14:52:34 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-02-21 11:39:40 +0000 |
commit | bd451435c02e10dd07247eae188dcca0446cc57a (patch) | |
tree | 59f33ac2447e049b67a4e836abd5b62a17fb7379 /util/aio-posix.c | |
parent | a153bf52b37e148f052b0869600877130671a03d (diff) |
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>
Diffstat (limited to 'util/aio-posix.c')
-rw-r--r-- | util/aio-posix.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/util/aio-posix.c b/util/aio-posix.c index 2173378570..2d51239ec6 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -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; |