Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added definition of incorrect forms to description of guideline

...

The double-checked locking idiom improves performance by limiting synchronization to the rare case of new instance creation and forgoing it during the common case of retrieving an already created instance.

Incorrect forms of the double-checked idiom include those that allow an uninitialized or partially initialized object to be published.

Noncompliant Code Example

...