Why is Locking of a Method or Block of Code for Thread Safety is called “Synchronized” and not “Lock” or “Locked
When a method or block of code is locked with the reserved “synchronized” key word in Java, the memory (i.e. heap) where the shared data is kept is synchronized. This means,When a synchronized block or method is entered after the lock has been acquired by a thread, it first reads any changes to the locked object … Read more