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 roland/cancelhandling] NPTL: Give cancelhandling fields type unsigned int.


On Wed, 2015-06-24 at 17:07 -0700, Roland McGrath wrote:
> This perturbed code generation for pthread_detach.c a bit more than I would
> have thought (on x86_64, i686, and arm), and I can't see any reason for
> that.  But I think the semantics of the generated code are identical.  The
> only other change to generated code is for nptl-init.c, where the compiler
> reversed the order of operands in a comparison instruction--but one where
> only eq/ne is ever tested, so it's trivially equivalent.
> 
> I wouldn't mind another set of eyes on the code generation changes to
> verify they are indeed wholly harmless.

What about the loads from cancelhandling that assign to an int variable
in these files:
nptl/cleanup_defer_compat.c
nptl/allocatestack.c
nptl/pthread_setcanceltype.c
nptl/cancellation.c
nptl/cleanup_defer.c
...

Shouldn't those variables be changed to unsigned int too?

All (or almost all) of those accesses should use atomics.  It may be
better to keep the casts in the futex_* calls for now and clean this up
in one chunk, using atomics and unsigned int everywhere.


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