Merged revisions 49636 via svnmerge from
[asterisk/asterisk.git] / channels / chan_sip.c
index 7159440..30a4bf7 100644 (file)
@@ -12751,12 +12751,17 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct
                return -1;
        }
        if ((d = ast_calloc(1, sizeof(*d)))) {
                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;
                /* 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, NULL, sip_park_thread, d) < 0) {
+               if (ast_pthread_create_background(&th, &attr, 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() */
                        /* 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() */