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

1
  • 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. Commented May 13, 2021 at 19:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.