diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-05-24 18:30:19 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-05-24 18:30:19 +0000 |
commit | 4b3a3fb14c298512ef69e17a710e210de14914fb (patch) | |
tree | 86895556d8f221a39105f4398a54d612fbbd3da8 /main/http.c | |
parent | bcd2bd8294408ca2f432747ef2e3073edecec4c1 (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: https://origsvn.digium.com/svn/asterisk/trunk@65968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/http.c')
-rw-r--r-- | main/http.c | 7 |
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; } |