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 /channels/chan_sip.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 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index ac72c112d..4c63ffe15 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -13640,24 +13640,18 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct return -1; } if ((d = ast_calloc(1, sizeof(*d)))) { - pthread_attr_t attr; - - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* Save original request for followup */ copy_request(&d->req, req); d->chan1 = transferee; /* Transferee */ d->chan2 = transferer; /* Transferer */ d->seqno = seqno; - if (ast_pthread_create_background(&th, &attr, sip_park_thread, d) < 0) { + if (ast_pthread_create_detached_background(&th, NULL, sip_park_thread, d) < 0) { /* Could not start thread */ free(d); /* We don't need it anymore. If thread is created, d will be free'd by sip_park_thread() */ - pthread_attr_destroy(&attr); return 0; } - pthread_attr_destroy(&attr); } return -1; } |