Subject: Re: locking in pthread_detach function
To: Jan Kryl <email@example.com>
From: Andrew Doran <firstname.lastname@example.org>
Date: 08/23/2007 20:16:32
On Thu, Aug 23, 2007 at 05:26:31PM +0200, Jan Kryl wrote:
> I have found a weird code in libpthread, file pthread.c, function
> thread->pt_flags |= PT_FLAG_DETACHED;
> Shouldn't we use thread->pt_lock instead of self->pt_lock for locking?
> Or am I missing something?
Well spotted. I have checked in a fix. There is another problem, since both
the kernel and the thread library maintain a record of whether a thread is
detached or not. Those two records are not exactly in sync.