‘Synchronize’ Gotcha: The Thread Locks The Object, Not The Method!

watch-cogs-wheels-parts

This is one of the fundamental aspects of Java synchronisation, but I have seen so many people get it wrong when I’m interviewing them. It’s very simple, but slightly contrary to how you might think synchronisation works.

Continue reading

Advertisements