Welcome to the Ranch Craig!
The quoted sentence is perfectly accurate, except that another thread could execute a static synchronized method because the locks are different. A static method uses the lock of its Class object.
When synchronize using synchronize(o1){o1.meth()} and calling o1 methods what is the effect of this? Does this lock out other threads from accessing any methods of o1?
If o1 has not used synchronized in the declaration of its instance methods, the code above won't prevent other threads from executing such methods. However it will prevent any other thread trying to call
any method from within a block synchronized on o1:
synchronized(o1) { /*not executed untill lock is free*/ }
Is it true that the whole point of synchronizing an object through this method is that you cannot modify source code to synchronize some methods and not others, so just have to synchronize the lot?
It is true that one of the reasons to use the synchronization blocks could be not being able to modify the source code of its class. Another is that you do not want to synchronize the whole method but only a portion of it.
In the former case it is intended that every access needing synchronization is writen within a synchronized block. Thus, it might not synchronize anything is that advice is not followed. But I wouldn't say that a synchronized block synchronizes the whole object. It would synchronize only the code writen within the block.
[ May 23, 2004: Message edited by: Jose Botella ]