[llvm-commits] CVS: llvm/lib/System/Mutex.cpp

Reid Spencer rspencer at reidspencer.com
Sat Jan 20 14:20:28 PST 2007


I think it would be more appropriate to add a test for
pthread_mutexattr_setpshared in the configure script. On Linux,
PTHREAD_PROCESS_PRIVATE is both an enumerator and a #define. If its only
an enumerator on some system, that check would be bad. Furthermore, a
pthread.h could define the macro while not defining the function (which
would be a bug, but it could happen).  The check for the function is the
safest.

Reid.

Perhaps, but what if PTHREAD_PROCESS_PRIVATE is defined in a header file
and
On Sat, 2007-01-20 at 14:13 -0800, Chris Lattner wrote:
> > For PR808: http://llvm.org/PR808 :
> > NetBSD also doesn't have pthread_mutexattr_setpshared
> 
> >
> > -#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
> > +#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined 
> > (__NetBSD__)
> >      // Make it a process local mutex
> >      errorcode = pthread_mutexattr_setpshared(&attr,  
> > PTHREAD_PROCESS_PRIVATE);
> >  #endif
> 
> Can't we just change this to:
> 
> #ifdef PTHREAD_PROCESS_PRIVATE
> 
> ?
> 
> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list