...
Semantics of volatile
do not guarantee the atomicity of complex compound operations that involve read-modify-write sequences such as incrementing a value. See CON01-J. Ensure that compound operations on shared variables are atomic for more information.
...