Am 03.11.2025 um 21:10 hat Eric Blake geschrieben:
> The code had three similar repetitions of an iteration over one or all
> of nsiocs to set up a GSource, and likewise for teardown. Since an
> upcoming patch wants to tweak whether GSource or AioContext is used,
> its better to consolidate that into one helper function for fewer
> places to edit later.
>
> Signed-off-by: Eric Blake <[email protected]>
> ---
> io/net-listener.c | 109 +++++++++++++++++++---------------------------
> 1 file changed, 45 insertions(+), 64 deletions(-)
> @@ -145,15 +174,11 @@ void
> qio_net_listener_set_client_func_full(QIONetListener *listener,
> GDestroyNotify notify,
> GMainContext *context)
> {
> - size_t i;
> -
> if (listener->io_func == func && listener->io_data == data) {
> return;
> }
>
> - if (listener->io_func) {
> - trace_qio_net_listener_watch_disabled(listener, "set_client_func");
> - }
> + qio_net_listener_unwatch(listener, "set_client_func");
> if (listener->io_notify) {
> listener->io_notify(listener->io_data);
> }
This changes the order between the io_notify() call and the unwatch. Is
this intentional? If so, maybe mention it in the commit message and why
it's safe.
Kevin