nptl: Extract <bits/atomic_wide_counter.h> from pthread_cond_common.c
authorFlorian Weimer <fweimer@redhat.com>
Wed, 17 Nov 2021 11:20:13 +0000 (12:20 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 17 Nov 2021 11:20:13 +0000 (12:20 +0100)
commit8bd336a00a5311bf7a9e99b3b0e9f01ff5faa74b
tree64f0019eef9c7d820a768f5a40d6386a1ab91184
parenta43c0b5483da4c5e3796af309864cb44256c02db
nptl: Extract <bits/atomic_wide_counter.h> from pthread_cond_common.c

And make it an installed header.  This addresses a few aliasing
violations (which do not seem to result in miscompilation due to
the use of atomics), and also enables use of wide counters in other
parts of the library.

The debug output in nptl/tst-cond22 has been adjusted to print
the 32-bit values instead because it avoids a big-endian/little-endian
difference.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
bits/atomic_wide_counter.h [new file with mode: 0644]
include/atomic_wide_counter.h [new file with mode: 0644]
include/bits/atomic_wide_counter.h [new file with mode: 0644]
misc/Makefile
misc/atomic_wide_counter.c [new file with mode: 0644]
nptl/Makefile
nptl/pthread_cond_common.c
nptl/tst-cond22.c
sysdeps/nptl/bits/thread-shared-types.h