I am trying to write a simple compare and swap inline assembly code. Here is my code
#include
#include
#include
Sorry for not answering your question directly, but my question is: why not use C11's
In your case you should either be using atomic_compare_exchange_weak()
or atomic_compare_exchange_strong()
.