1

In miniaudio they used to add volatile to indicate that a variable can be changed by multiple threads but they removed it, change log "Add the MA_ATOMIC annotation for use with variables that should be used atomically and remove unnecessary volatile qualifiers."

They added a #define MA_ATOMIC that does nothing instead of using volatile. Why isn't the volatile qualifier necessary?

The repo: https://github.com/mackron/miniaudio

Jojolatino
  • 696
  • 5
  • 11
  • `volatile` is not so much *optional* as it is *insufficient*. And if you put in measures that are sufficient, such as protecting access via a mutex or using an atomic object, then `volatile` doesn't provide anything useful on top. – John Bollinger May 13 '21 at 19:12

0 Answers0