Thu Mar 6 07:00:01 CET 2003

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matteo Brancaleoni
2003-03-06 06:00:17 +00:00
parent fa50831650
commit a8723ad68f
6 changed files with 33 additions and 9 deletions

View File

@@ -530,6 +530,10 @@ static void *accept_thread(void *ignore)
struct sockaddr_in sin;
int sinlen;
struct mansession *s;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
for (;;) {
sinlen = sizeof(sin);
as = accept(asock, &sin, &sinlen);
@@ -550,9 +554,10 @@ static void *accept_thread(void *ignore)
s->next = sessions;
sessions = s;
ast_pthread_mutex_unlock(&sessionlock);
if (pthread_create(&t, NULL, session_do, s))
if (pthread_create(&t, &attr, session_do, s))
destroy_session(s);
}
pthread_attr_destroy(&attr);
return NULL;
}