emplate (integral) (1) |
template <class T> T atomic_fetch_and (volatile atomic<T>* obj, T val) noexcept; template <class T> T atomic_fetch_and (atomic<T>* obj, T val) noexcept; |
---|---|
overloads (2) |
T atomic_fetch_and (volatile A* obj, T val) noexcept; T atomic_fetch_and (A* obj, T val) noexcept; |
#include <iostream> #include <atomic> #include <stdio.h> int main() { short int revents = 0x0888; short int revents2 = __atomic_fetch_and(&revents,0x0800,std::memory_order_seq_cst); printf("%4x and %4x \n", revents, revents2); }
root@ubuntu:~/c++# ./atom4 800 and 888
原文:https://www.cnblogs.com/dream397/p/14661860.html