[Asterisk-code-review] chan sip: Give more time for TCP/TLS threads to stop. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Tue Apr 26 11:05:23 CDT 2016


Richard Mudgett has posted comments on this change.

Change subject: chan_sip: Give more time for TCP/TLS threads to stop.
......................................................................


Patch Set 3: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/2701/3/channels/chan_sip.c
File channels/chan_sip.c:

PS3, Line 35354: 		ast_cond_t cond;
               : 		struct timeval start = ast_tvnow();
               : 		struct timespec end = {
               : 			.tv_sec = start.tv_sec + 5,
               : 			.tv_nsec = start.tv_usec * 1000,
               : 		};
               : 
               : 		ast_cond_init(&cond, NULL);
               : 
               : 		ao2_lock(threadt);
               : 		while (ast_cond_timedwait(&cond, ao2_object_get_lockaddr(threadt), &end) != ETIMEDOUT) {
               : 		}
               : 		ao2_unlock(threadt);
               : 
               : 		ast_cond_destroy(&cond);
Wow.  What a round about way to do sleep(5).

Why don't you have a loop that checks the container count after every sched_yeild() and if 5 seconds have elapsed then quit and complain that the TCP/TLS threads did not become empty.


-- 
To view, visit https://gerrit.asterisk.org/2701
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idc6262b670ca49ede32061159e323b7b63c6f3c6
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list