Subject: Re: locking in pthread_detach function
To: Jan Kryl <loo@bazmek.net>
From: Bernd Ernesti <netbsd@lists.veego.de>
List: netbsd-bugs
Date: 08/23/2007 19:37:46
Hi,

netbsd-bugs is mainly for bugs send via send-pr or the webinterface
http://www.netbsd.org/support/send-pr.html

Please use send-pr or ask on another list, maybe current-users or
tech-userlevel.

Regards,
Bernd

On Thu, Aug 23, 2007 at 05:26:31PM +0200, Jan Kryl wrote:
> Hi,
> 
> I have found a weird code in libpthread, file pthread.c, function
> pthread_detach():
> 
> ...
>         pthread_spinlock(&self->pt_lock);
>         thread->pt_flags |= PT_FLAG_DETACHED;
>         pthread_spinunlock(&self->pt_lock);
> ...
> 
> Shouldn't we use thread->pt_lock instead of self->pt_lock for locking?
> Or am I missing something?
> 
> Cheers,
> Jan