__sync_bool_compare_and_swap如何使用内存顺序?

时间:2019-06-27 02:03:15

标签: gcc atomic compare-and-swap

我目前正在调整性能,

// As i knew it does Full seq memory barrier, but I want it release order if success and relaxed order if failed
while(!__sync_bool_compare_and_swap(MyData, 0, newData)
     ;

return done;

0 个答案:

没有答案