Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: xrefed CON04-J

...

This compliant solution uses an internal private lock object. This is one of the few cases where a raw Object is useful. Private lock objects are discussed in CON04-J. Synchronize using an internal private lock object.

Code Block
bgColor#ccccff
private final Object lock = new Object();

synchronized(lock) { 
  // ...
}

...