Subject: Re: CVS commit: src/lib/libpthread
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Andrew Doran <ad@netbsd.org>
List: source-changes
Date: 12/24/2007 16:19:05
On Tue, Dec 25, 2007 at 12:50:19AM +0900, YAMAMOTO Takashi wrote:

> > - Always create LWPs detached. Do join/exit sync mostly in userland. When
> >   looped on a dual core box this seems ~30% quicker than using lwp_wait().
> >   Reduce number of lock acquire/release ops during thread exit.
> 
> - you don't need to check EINTR from pthread_cond_wait.
> - pthread_cond_wait doesn't release the mutex on errors.

I have changed it assert that zero is always returned.

> - what's pt_droplock for?  pthread_cond_wait doesn't use pthread__cancelled.

Fixed.

> - what's pthread_mutex_held_np in pthread__cancelled for?
>   why don't you use pthread_cleanup_push?

Weak insurance against use of functions that aren't signal safe - although
it doesn't make much difference at the moment. On reflection that's not of
much use. There are lock order issues since we disable cancellation before
calling the cleanup handlers. I'll think of a better way.

Thanks,
Andrew