vidify / old-audiosync

First implementation of the audio synchronization feature for Vidify, now obsolete
GNU Lesser General Public License v3.0
17 stars 3 forks source link

The global status variable might not need to be volatile #25

Closed marioortizmanero closed 4 years ago

marioortizmanero commented 4 years ago

Volatile is a very mis-used keyword, it's probably not intended for the global status variable. Some discussion here https://e2e.ti.com/support/tools/ccs/f/81/t/3415?Multi-threading-and-global-variables-volatile-keyword-required-

marioortizmanero commented 4 years ago

volatile is actually needed. Even if it's often misused, in this case it's a good idea to do so. That way, it's ensured that the variable will always be read from memory, rather than from a register, and there won't be issues with the compiler trying to optimize something it shouldn't.