summaryrefslogtreecommitdiff
path: root/main/manager.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 /main/manager.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 'main/manager.c')
-rw-r--r--main/manager.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/main/manager.c b/main/manager.c
index 43dd43af5..3d3c06ab0 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -1933,7 +1933,6 @@ static int action_originate(struct mansession *s, const struct message *m)
char tmp2[256];
pthread_t th;
- pthread_attr_t attr;
if (!name) {
astman_send_error(s, m, "Channel not specified");
return 0;
@@ -1988,14 +1987,11 @@ static int action_originate(struct mansession *s, const struct message *m)
ast_copy_string(fast->account, account, sizeof(fast->account));
fast->timeout = to;
fast->priority = pi;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- if (ast_pthread_create(&th, &attr, fast_originate, fast)) {
+ if (ast_pthread_create_detached(&th, NULL, fast_originate, fast)) {
res = -1;
} else {
res = 0;
}
- pthread_attr_destroy(&attr);
}
} else if (!ast_strlen_zero(app)) {
res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 1, l, n, vars, account, NULL);