Vendikonda : The purpose of synchronization is to protect an object from being
changed by any other thread while the current thread is using the it. The protected
(synchronized) object can be any object; second party, third party or whatever.
So I may not fully understand you question. Can you explain further?
Using an external Object (rather than this) to synchronize on provides several things:
1) It allows multiple objects running in different threads to synchronize with each other, via a shared lock instance.
In a real word(ish) situation let's say you have a producer which adds things to a List, and you have a Consumer which reads the List, but also may change it (remove values, for example). It would be unsafe for both the Producer and the Consumer to work on the List at the same time, and so you need to synchronize. Since the Producer and Consumer are not the same Object, they can't synchronize on their self, they need something shared (and in this case, the List is the shared object which needs to be protected, so it makes most sense to synchornize on):
2) The second thing you get from using some object other than this to synchronize on would be granularity. You can have different Objects to lock on for different situations.
Again, in a real world(ish) situation as an example, let's say you have a College Degree Program. You have two different Lists - a List of Teachers, and a List of Students. Each List should be protected from being accessed by multiple threads at the same time, but you don't need to block threads accessing the List<Teacher> one a different thread is accessing List<Student>. So you would want to synchronize on the access to each List using a different lock (and again the List itself makes for a good lock):