diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2007-01-05 17:10:59 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2007-01-05 17:10:59 +0000 |
commit | a8dc50812f80b24548102a727a0a64b5242db357 (patch) | |
tree | 3cd69ed5a1753f38832c2fed14007bdd63ead1e6 /channels/chan_skinny.c | |
parent | 2288b11bf4913a2171077ae743ac6a1084bcd5fb (diff) |
Merged revisions 49636 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r49636 | kpfleming | 2007-01-05 11:09:00 -0600 (Fri, 05 Jan 2007) | 10 lines
Merged revisions 49635 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r49635 | kpfleming | 2007-01-05 10:56:40 -0600 (Fri, 05 Jan 2007) | 2 lines
ensure that threads which are supposed to be detached (because we aren't going to wait on them) are created properly
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r-- | channels/chan_skinny.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index df0d1e4de..927172ed6 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -749,7 +749,6 @@ static struct in_addr __ourip; struct ast_hostent ahp; struct hostent *hp; static int skinnysock = -1; -static pthread_t tcp_thread; static pthread_t accept_t; static char context[AST_MAX_CONTEXT] = "default"; static char language[MAX_LANGUAGE] = ""; @@ -4271,6 +4270,7 @@ static void *accept_thread(void *ignore) struct protoent *p; int arg = 1; pthread_attr_t attr; + pthread_t tcp_thread; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); @@ -4299,7 +4299,7 @@ static void *accept_thread(void *ignore) sessions = s; ast_mutex_unlock(&sessionlock); - if (ast_pthread_create(&tcp_thread, NULL, skinny_session, s)) { + if (ast_pthread_create(&tcp_thread, &attr, skinny_session, s)) { destroy_session(s); } } @@ -4678,13 +4678,6 @@ static int unload_module(void) monitor_thread = AST_PTHREADT_STOP; ast_mutex_unlock(&monlock); - if (tcp_thread && (tcp_thread != AST_PTHREADT_STOP)) { - pthread_cancel(tcp_thread); - pthread_kill(tcp_thread, SIGURG); - pthread_join(tcp_thread, NULL); - } - tcp_thread = AST_PTHREADT_STOP; - ast_mutex_lock(&netlock); if (accept_t && (accept_t != AST_PTHREADT_STOP)) { pthread_cancel(accept_t); |