Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added - starting timers is also unsafe..I don't think we need another NCE for this, or do we?

...

Similar to this noncompliant code example, threads should not be started from constructors. See CON14-J. Do not let the "this" reference escape during object construction for more information. Starting timers to perform recurring tasks from within code responsible for initialization also results in liveness issues.

Compliant Solution (static initializer, no background threads)

...