runtime, sync: use __atomic intrinsics instead of __sync

GCC has supported the __atomic intrinsics since 4.7.  They are better
than the __sync intrinsics in that they specify a memory model and,
more importantly for our purposes, they are reliably implemented
either in the compiler or in libatomic.


Change-Id: I27333d59e7c795c1e2a6de63eb5eab67d9fe13b2
Reviewed-by: Cherry Zhang <>
Reviewed-by: Than McIntosh <>
13 files changed