From: Kevin Harwell Date: Tue, 3 May 2016 20:39:32 +0000 (-0500) Subject: res_pjsip_outbound_publish: Won't unload if condition wait times out X-Git-Tag: 13.10.0-rc1~75^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4752ef02e02dfcb1b1ec38d154eb9bc42736df3c;p=thirdparty%2Fasterisk.git res_pjsip_outbound_publish: Won't unload if condition wait times out When res_pjsip_outbound_publish unloads it has to wait for all current publishing objects to get done. However if the wait condition times out then it does not fail the unload. This sometimes results in an infinite loop check while unloading. This patch now fails the unload operation if the condition times out. Change-Id: Id57b8cbed9d61222690fcba1e4f18e259df4c7ec --- diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c index 60f9bbb177..141cdef620 100644 --- a/res/res_pjsip_outbound_publish.c +++ b/res/res_pjsip_outbound_publish.c @@ -1200,7 +1200,7 @@ static int unload_module(void) /* wait for items to unpublish */ ast_verb(5, "Waiting to complete unpublishing task(s)\n"); - while (unloading.count) { + while (unloading.count && !res) { res = ast_cond_timedwait(&unloading.cond, &unloading.lock, &end); } ast_mutex_unlock(&unloading.lock);