Re: nss and pthreads and wine, oh my!

From: Daniel Eischen <eischen_at_vigrid.com>
Date: Wed, 10 Dec 2003 15:04:37 -0500 (EST)
On Wed, 10 Dec 2003, Jacques A. Vidrine wrote:

> On Wed, Dec 10, 2003 at 12:39:59AM -0500, Daniel Eischen wrote:
> > Yes, I think libc should only call locking primitives when
> > __isthread != 0.
> 
> Hi Dan,
> 
> You don't mean that, do you?  You seem to be implying that pthread
> functions would have to be invoked in libc something like this:
> 
>   result = __isthreaded ? _pthread_mutex_trylock(&foo_lock) : 0;
>   if (result != 0)
>           /* error */;
> 
> or use the macros in reentrant.h.
> 
> But, maybe I'm just misunderstanding you.  I believe the thread
> functions are `stubbed out' in the non-thread case?

They are, but when libpthread is linked in, even if threads
are not created, there's no reason to call the pthread sync
functions if we're not threaded.  There is a bit of overhead
associated with calling these things that can be avoided
simply by checking __isthreaded.

-- 
Dan Eischen
Received on Wed Dec 10 2003 - 11:04:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:33 UTC