Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor fix, see last edit

...

The double-checked locking pattern uses block synchronization instead of method synchronization. It strives to make the previous code example faster by installing a null check before attempting to synchronize. The pattern strives to make the previous code example faster by installing a null check before attempting to synchronize. This makes expensive synchronization necessary only for initialization, and dispensable for the common case of retrieving the value of helper. The noncompliant code example shows the originally proposed DCL pattern.

...