What is the difference between synchronizing an object and synchronizing the instance? And what is more efficient?
synchronize(this) {
// things to synchronize
}
Or
private static final Object LOCK = new Object();
synchronize(LOCK) {
// things to synchronize
}