Il mer 22 mar 2023, 15:55 Stefan Hajnoczi <stefa...@redhat.com> ha scritto:

> +    /* The list must not change while we add fds to epoll */
> +    if (!qemu_lockcnt_dec_if_lock(&ctx->list_lock)) {
> +        return false;
> +    }
> +
> +    ok = fdmon_epoll_try_enable(ctx);
> +
> +    qemu_lockcnt_unlock(&ctx->list_lock);
>

Shouldn't this be inc_and_unlock to balance the change made by dec_if_lock?

Paolo

+
> +    if (!ok) {
> +        fdmon_epoll_disable(ctx);
> +    }
> +    return ok;
>  }
>
>  void fdmon_epoll_setup(AioContext *ctx)
> --
> 2.39.2
>
>

Reply via email to