...
Code Block | ||
---|---|---|
| ||
// private lock object idiom - thawts denial-of-service attack public class importantObj { private final Object lock = new Object(); public void changeValue() { // lock on this synchronized(lock) { ... } } ... } |
...
...
Code Block | ||
---|---|---|
| ||
// private lock object idiom - thawts denial-of-service attack public class importantObj { private final Object lock = new Object(); public void changeValue() { // lock on this synchronized(lock) { ... } } ... } |
...