Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added a sentence about synchronization to the intro because it had a corresponding one for volatile. But now this leaves out AtomicBoolean solution.

...

However, synchronization is a more secure alternative in situations where the volatile keyword or an java.util.concurrent.atomic.Atomic* field is inappropriate, such as if a variable's new value depends on its old value. Refer to CON01-J. Ensure that composite compound operations on shared variables are atomic for more information.

...