aboutsummaryrefslogtreecommitdiffstats
path: root/main/http.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 18:30:19 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 18:30:19 +0000
commita42bc96f14e6c4c6c8fe8e7c743df555036e885b (patch)
tree86895556d8f221a39105f4398a54d612fbbd3da8 /main/http.c
parentf97bf5fd4d30bd179aac274961e7695ddc60e165 (diff)
Add a new API call for creating detached threads. Then, go replace all of the
places in the code where the same block of code for creating detached threads was replicated. (patch from bbryant) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@65968 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/http.c')
-rw-r--r--main/http.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/main/http.c b/main/http.c
index c69ac72ff..5d652b8dc 100644
--- a/main/http.c
+++ b/main/http.c
@@ -907,7 +907,6 @@ void *server_root(void *data)
socklen_t sinlen;
struct server_instance *ser;
pthread_t launched;
- pthread_attr_t attr;
for (;;) {
int i, flags;
@@ -935,17 +934,13 @@ void *server_root(void *data)
ser->fd = fd;
ser->parent = desc;
memcpy(&ser->requestor, &sin, sizeof(ser->requestor));
-
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- if (ast_pthread_create_background(&launched, &attr, make_file_from_fd, ser)) {
+ if (ast_pthread_create_detached_background(&launched, NULL, make_file_from_fd, ser)) {
ast_log(LOG_WARNING, "Unable to launch helper thread: %s\n", strerror(errno));
close(ser->fd);
free(ser);
}
- pthread_attr_destroy(&attr);
}
return NULL;
}