mariadb/include/atomic
Davi Arnaut cfe8acb198 Bug#56760: my_atomics failures on osx10.5-x86-64bit
The problem was due to a misuse of GCC asm constraints used to
implement a atomic load. On x86_64, the load was implemented
as a cmpxchg which implicitly uses the eax register as a
source and destination operand, yet the dummy value used for
comparison wasn't being properly loaded into eax (and other
problems).

The core problem is that cmpxchg is unnecessary as a load
on x86_64 as there are other simpler instructions such
as xadd. Even though, such instructions are only used to
have a memory barrier as load and stores are atomic by
definition. Hence, the solution is to explicitly issue the
required CPU and compiler barriers.

include/atomic/x86-gcc.h:
  Issue a synchronizing instruction before loading the value.
  Afterwards, issue a compiler barrier to prevent reordering.
2010-11-30 21:19:49 -02:00
..
gcc_builtins.h Bug#22320: my_atomic-t unit test fails 2010-07-23 09:37:10 -03:00
generic-msvc.h Fix for Windows atomics 2009-12-16 00:33:15 +01:00
nolock.h Bug#22320: my_atomic-t unit test fails 2010-07-23 09:37:10 -03:00
rwlock.h WL#2595 kernel-independent atomic operations 2009-11-17 17:11:32 -07:00
solaris.h Bug#52261: 64 bit atomic operations do not work on Solaris i386 .. 2010-07-27 10:25:11 -03:00
x86-gcc.h Bug#56760: my_atomics failures on osx10.5-x86-64bit 2010-11-30 21:19:49 -02:00