chetan dhumane wrote:Thanks
Then how that synch block will help me.
Modifying the code as I suggested will make use of the synchronized and will run sequentially. Otherwise it is not guaranteed to run in a sequence. Please note that if you are synchronizing, in other words acquiring lock, make sure it is on the single object. Otherwise it really does not make sense.