理论基础是CAS(Compare And Swap),本质上需要硬件支持,C++11中有相应的接口 https://www.cnblogs.com/alantu2018/p/8469168.html https://coolshell.cn/articles/8239.html