This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[arm] bits/atomic.h
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-ports at sourceware dot org
- Date: Thu, 24 Nov 2011 12:00:50 -0800
- Subject: [arm] bits/atomic.h
> /* Atomic compare and exchange. These sequences are not actually atomic;
> there is a race if *MEM != OLDVAL and we are preempted between the two
> swaps. However, they are very close to atomic, and are the best that a
> pre-ARMv6 implementation can do without operating system support.
> LinuxThreads has been using these sequences for many years. */
Surely we can at least use the gcc builtins, which fall back to the kernel support. Leaving this as-is just seems like a recipe for disaster.
Although perhaps this should be part of a general cleanup of these headers using the gcc atomic builtins (gcc 4.7) or sync builtins (prior). I assume we don't actually support too many older versions of gcc...
r~