This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 04/11] Add elision to pthread_mutex_{try,timed,un,}lock


> > +static inline __attribute__((always_inline)) void
> > +adaptive_lock (pthread_mutex_t *mutex)
> > +{
> > +  if (! __is_smp)
> > +    return;
> 
> How can this be correct?  Depending on __is_smp, we either return with
> an acquired lock or without.  The original code called the following in
> case of ! __is_smp:
>       /* Normal mutex.  */
>       LLL_MUTEX_LOCK (mutex);
>       assert (mutex->__data.__owner == 0);

Good catch. I fixed this now.

BTW looking at the is_smp_system() code it would really surprise me
if this variable was ever set on a modern system. Maybe it should
be just removed.

It checks for UP kernels which noone really uses anymore.

-Andi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]