From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 1 Sep 2021 15:39:32 +0000 (+0100) Subject: lock the avahi thread before modifying the strings X-Git-Tag: 4.1-dev~4^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fde77c45d50d92dd64ba91192af6a149b850d7f;p=thirdparty%2Fshairport-sync.git lock the avahi thread before modifying the strings --- diff --git a/mdns_avahi.c b/mdns_avahi.c index c4568078..95984419 100644 --- a/mdns_avahi.c +++ b/mdns_avahi.c @@ -334,6 +334,7 @@ static int avahi_update(char **txt_records, char **secondary_txt_records) { else selected_interface = AVAHI_IF_UNSPEC; + avahi_threaded_poll_lock(tpoll); if (txt_records != NULL) { if (text_record_string_list) avahi_string_list_free(text_record_string_list); @@ -356,6 +357,8 @@ static int avahi_update(char **txt_records, char **secondary_txt_records) { if (err != 0) debug(1, "avahi_update error updating secondary txt records."); } + + avahi_threaded_poll_unlock(tpoll); return 0; }