Originally posted by Someswara Chittlella:
If have external synchronization block on object of ClassA and I dont call any methods on object of ClassA. In that case will my thread code exectues if there is already lock on that Object?
So you are saying...
if some other thread already holds the lock of instanceOfClassA, will the callSomeMethod...() method execute (in my thread), even though it doesn't use the instance of class A? No. To run the code in the synchronized block, it needs to grab the lock specified in the synchronized block.
Henry