diff --git a/channels/chan_sip.c b/channels/chan_sip.c index db3d3f1c1082014aa14fabb43d142a137c1d646c..a93fb943f141b237a1fdd05247556c52f2c69581 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11377,15 +11377,7 @@ restartsearch: ast_mutex_unlock(&sip->lock); } ast_mutex_unlock(&iflock); - /* Don't let anybody kill us right away. Nobody should lock the interface list - and wait for the monitor list, but the other way around is okay. */ - ast_mutex_lock(&monlock); - /* Lock the network interface */ - ast_mutex_lock(&netlock); - /* Okay, now that we know what to do, release the network lock */ - ast_mutex_unlock(&netlock); - /* And from now on, we're okay to be killed, so release the monitor lock as well */ - ast_mutex_unlock(&monlock); + pthread_testcancel(); /* Wait for sched or io */ res = ast_sched_wait(sched);