[atomic] Fix get() impl
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 1 Aug 2018 05:51:38 +0000 (22:51 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 1 Aug 2018 05:51:38 +0000 (22:51 -0700)
commit896ff15ae60a4a4b94c62946e69196b877839bb5
tree252469ac832988695603870ae48c68db59b0a6a4
parentd7a15799d40dac1f9521674a82c3293a7cb42ee4
[atomic] Fix get() impl

Originally, glib's atomic_get was implemented as "memory_barrier; load".
I copied this into cairo, fontconfig, and harfbuzz.  However, that's
wrong.  Correct way is "load; memory_barrier".  The details are long
and hard to fully grasp.  Best to read:

  https://www.kernel.org/doc/Documentation/memory-barriers.txt

Also see my report against GNOME:

  https://gitlab.gnome.org/GNOME/glib/issues/1449

Note that this is irrelevant if C++11-like atomic ops are available.
src/hb-atomic-private.hh