diff options
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 45827b448..cbbda4e73 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -35201,7 +35201,7 @@ static int unload_module(void) struct sip_pvt *p; struct sip_threadinfo *th; struct ao2_iterator i; - int wait_count; + struct timeval start; ast_sip_api_provider_unregister(); @@ -35351,11 +35351,11 @@ static int unload_module(void) * joinable. They can die on their own and remove themselves * from the container thus resulting in a huge memory leak. */ - wait_count = 1000; - while (ao2_container_count(threadt) && --wait_count) { + start = ast_tvnow(); + while (ao2_container_count(threadt) && (ast_tvdiff_sec(ast_tvnow(), start) < 5)) { sched_yield(); } - if (!wait_count) { + if (ao2_container_count(threadt)) { ast_debug(2, "TCP/TLS thread container did not become empty :(\n"); } |