What is the reason for std::atomic<T>::compare_exchange_*
taking the expected value by reference, instead of taking it by value?
compare_exchange_*
changes expected
to actual value if operation fails. It makes loops a bit simpler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With