MFC r240970:
- Make C11 atomic macros usable in expressions:
- Replace do-while statements with void expressions.
- Wrap __asm statements in statement expressions.
- Make the macros function-like:
- Evaluate all arguments exactly once.
- Make sure there's a sequence point between evaluation of the
arguments and the function body. Arguments should be evaluated
before any memory barriers.
- Fix use of __atomic_is_lock_free built-in. It requires the address
of an atomic variable as second argument. Use this built-in on clang
as well because clang's __c11_atomic_is_lock_free only takes the size
of the variable into account.
- In atomic_exchange_explicit put the barrier before instead of after
the __sync_lock_test_and_set call.
git-svn-id: svn://svn.freebsd.org/base/stable/9@254478
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f