Hmm...there is only one kind of synchronization.
If you synchronize a whole method, the lock goes on instance of the object in which the method is defined. If you synchronize just a block of code, then you get to choose to which object the code is locked. But in either case, the synchronization simply prevents more than one
thread from calling on that code at any given time.
That brings up an interesting question. Is it possible, I wonder, to change during run time which object gets a given synchronized code block's lock. Something like:
synchronized(k.next()) {
}
where k is an iterator on some collection.
Chris