[sheepdog] [PATCH UPDATE] work: make short thread DETACHED

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jul 3 12:33:01 CEST 2012


At Tue, 03 Jul 2012 18:25:23 +0800,
Liu Yuan wrote:
> 
> On 07/03/2012 06:22 PM, MORITA Kazutaka wrote:
> > If we detach the thread just after it starts, isn't it better to
> > create it in a detached state using pthread_attr_setdetachstate?
> 
> why better? It cost several more lines to init attr and destroy it. what
> is benefit using attr over pathread_detach()?

I thought that it makes clear that the thread is never in a joinable
state, but looks like it's a matter of taste...

Reviewed-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>



More information about the sheepdog mailing list