Advertisement
Guest User

Untitled

a guest
Jan 31st, 2022
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <stdatomic.h>
  2.  
  3. // https://clang.llvm.org/docs/LanguageExtensions.html#langext-c11-atomic
  4. // if stdatomic.h exists this program will not compile with clang
  5. // (doesn't work at all with g++ because it does not implicitly include its
  6. // own stdatomic)
  7. int main(int argc, char **argv)
  8. {
  9.     _Atomic int x = 23;
  10.     int y = 0;
  11.     int z = 0;
  12.     atomic_compare_exchange_strong(&x, &y, z);
  13.    
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement