[asterisk-dev] Re: russell: trunk r65968 - in /trunk: apps/ channels/ include/asterisk/ main/ pbx/

Tony Mountifield tony at softins.clara.co.uk
Fri May 25 00:33:59 MST 2007


In article <20070524183022.6B564A948EA at lists.digium.internal>,
 <svn-commits at lists.digium.com> wrote:
> Author: russell
> Date: Thu May 24 13:30:19 2007
> New Revision: 65968
> 
> URL: http://svn.digium.com/view/asterisk?view=rev&rev=65968
> Log:
> 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)
> [...]
> Modified: trunk/apps/app_meetme.c
> URL:
> http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=65968&r1=65967&r2=65968
> ==============================================================================
> --- trunk/apps/app_meetme.c (original)
> +++ trunk/apps/app_meetme.c Thu May 24 13:30:19 2007
> @@ -1428,10 +1428,7 @@
>  			ast_hangup(conf->lchan);
>  			conf->lchan = NULL;
>  		} else {
> -			pthread_attr_init(&conf->attr);
> -			pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
> -			ast_pthread_create_background(&conf->recordthread, &conf->attr, recordthread, conf);
> -			pthread_attr_destroy(&conf->attr);
> +			ast_pthread_create_detached_background(&conf->recordthread, &conf->attr, recordthread, conf);

Scanning through the patch, this was the only instance I saw that passed
a pointer to an attr as the second arg instead of NULL.

Is there any reason the attr is part of the conf structure? It just appears
to get inited and destroyed in the same way as a temporary one would, and
every other call to ast_pthread_create_background() was content to let it
use a local temporary attr.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org


More information about the asterisk-dev mailing list