...
If the method changeValue
is called in this case, the lock is obtained on a private Object
that is both invisible and inaccessible from the caller. The this
instance is not vulnerable from denial-of-service attack. Thread-safe class may be protected in this way by using the private lock object idiom.
Wiki Markup |
---|
The detailed waydetails of using private object lock can refer to \[[CON36-J. Always synchronize on the appropriate object|CON36-J. Always synchronize on the appropriate object]\]. |
...