Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This guideline applies to all uses of Collection classes including the thread-safe Hashtable class. Enumerations of the objects of a Collection and iterators also require explicit synchronization on the Collection object or any single lock object.

Some primitive operators may also not be atomic; see CON01-J. Do not assume all primitive operators are atomic for more information.

Noncompliant Code Example (AtomicReference)

...