...
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 | ||
---|---|---|
| ||
private final Object lock = new Object(); synchronized(lock) { // ... } |
...