mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-04 03:20:33 +00:00
Merge "chan_sip: Give more time for TCP/TLS threads to stop." into 13
This commit is contained in:
@@ -35201,7 +35201,7 @@ static int unload_module(void)
|
|||||||
struct sip_pvt *p;
|
struct sip_pvt *p;
|
||||||
struct sip_threadinfo *th;
|
struct sip_threadinfo *th;
|
||||||
struct ao2_iterator i;
|
struct ao2_iterator i;
|
||||||
int wait_count;
|
struct timeval start;
|
||||||
|
|
||||||
ast_sip_api_provider_unregister();
|
ast_sip_api_provider_unregister();
|
||||||
|
|
||||||
@@ -35351,11 +35351,11 @@ static int unload_module(void)
|
|||||||
* joinable. They can die on their own and remove themselves
|
* joinable. They can die on their own and remove themselves
|
||||||
* from the container thus resulting in a huge memory leak.
|
* from the container thus resulting in a huge memory leak.
|
||||||
*/
|
*/
|
||||||
wait_count = 1000;
|
start = ast_tvnow();
|
||||||
while (ao2_container_count(threadt) && --wait_count) {
|
while (ao2_container_count(threadt) && (ast_tvdiff_sec(ast_tvnow(), start) < 5)) {
|
||||||
sched_yield();
|
sched_yield();
|
||||||
}
|
}
|
||||||
if (!wait_count) {
|
if (ao2_container_count(threadt)) {
|
||||||
ast_debug(2, "TCP/TLS thread container did not become empty :(\n");
|
ast_debug(2, "TCP/TLS thread container did not become empty :(\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user