[PATCH] Unify pthread_spin_[try]lock implementations.
Maxim Kuvyrkov
maxim@codesourcery.com
Wed Aug 15 16:53:00 GMT 2012
On 16/08/2012, at 4:43 AM, Roland McGrath wrote:
>> This is just an indentation artifact in git commit log. It will be
>> properly formatted in the actual ChangeLog file.
>
> OK. Note that we don't use long things like ChangeLog fragments for the
> git commit messages, just a short subject line.
>
>> The machine-specific pthread_spin_lock.c files go to
>> ports/sysdeps/<machine>/nptl/pthread_spin_lock.c, which comes first in
>> sysdeps search path before the generic nptl/pthread_spin_lock.c. So it
>> is either '#include_next <nptl/pthread_spin_lock.c>' or '#include
>> "../../../../nptl/pthread_spin_lock.c"'. The former looks less ugly than
>> the later.
>
> Hmm. Last I knew #include_next from a main source file didn't work as you
> expect. Did GCC change?
This works at least with GCC 4.4 and GCC 4.8, albeit with a warning:
../ports/sysdeps/mips/nptl/pthread_spin_lock.c:19:2: warning: #include_next in primary source file [enabled by default]
#include_next <nptl/pthread_spin_lock.c>
^
Given that previous versions of GCC can, potentially, fail to compile this, I would rather use the "../../../../nptl/pthread_spin_lock.c" version. Any alternative suggestions?
Thanks,
--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics
More information about the Libc-alpha
mailing list