Subject: locking in pthread_detach function
To: None <netbsd-bugs@netbsd.org>
From: Jan Kryl <loo@bazmek.net>
List: netbsd-bugs
Date: 08/23/2007 17:26:31
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