...
Declaring shared variables as volatile ensures visibility and limits reordering of accesses. Volatile accesses do not guarantee the atomicity of composite operations such as incrementing a variable. Consequently, this recommendation volatile is not applicable in cases where the atomicity of composite operations must be guaranteed (see CON01-J. Do not assume that composite operations on primitive data are atomic).
...