summaryrefslogtreecommitdiff
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-05-24 18:30:19 +0000
committerRussell Bryant <russell@russellbryant.com>2007-05-24 18:30:19 +0000
commit4b3a3fb14c298512ef69e17a710e210de14914fb (patch)
tree86895556d8f221a39105f4398a54d612fbbd3da8 /channels/chan_mgcp.c
parentbcd2bd8294408ca2f432747ef2e3073edecec4c1 (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 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index f9caf584d..3895330c5 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -2956,9 +2956,6 @@ static void handle_hd_hf(struct mgcp_subchannel *sub, char *ev)
struct mgcp_endpoint *p = sub->parent;
struct ast_channel *c;
pthread_t t;
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
/* Off hook / answer */
if (sub->outgoing) {
@@ -3006,7 +3003,7 @@ static void handle_hd_hf(struct mgcp_subchannel *sub, char *ev)
}
c = mgcp_new(sub, AST_STATE_DOWN);
if (c) {
- if (ast_pthread_create(&t, &attr, mgcp_ss, c)) {
+ if (ast_pthread_create_detached(&t, NULL, mgcp_ss, c)) {
ast_log(LOG_WARNING, "Unable to create switch thread: %s\n", strerror(errno));
ast_hangup(c);
}
@@ -3034,7 +3031,6 @@ static void handle_hd_hf(struct mgcp_subchannel *sub, char *ev)
/*ast_queue_control(sub->owner, AST_CONTROL_ANSWER);*/
}
}
- pthread_attr_destroy(&attr);
}
static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req, struct sockaddr_in *sin)