On 17/05/2016 18:47, Sergey Fedorov wrote: >>> >> On 14/05/16 06:34, Emilio G. Cota wrote: >>>> >>> This new helper expands to __atomic_test_and_set with acquire semantics >>>> >>> where available; otherwise it expands to __sync_test_and_set, which >>>> >>> has acquire semantics. >>> >> Why don't also add atomic_clear_release() for completeness? >> > The previous patch adds atomic_set_release. > Yes, but it would take the advantage of __sync_lock_release() being just > a release barrier rather than a full barrier of smp_mb() in > atomic_set_release(). But that's only the case for legacy __sync > built-ins (before GCC 4.7.0), though.
That will be fixed soon by adding smp_mb_acquire() and smp_mb_release(). :) Paolo