When we mark a method as synchronized and then call this method,
then this method will first acquire the intrinsic lock of the object in
which that method is mentioned.
Once the synchronized method returns, it releases the lock.
In case the synchronized method throws an exception, the intrinsic
lock will be released.
Sample code equivalent to a synchronized method is:
public void myMethod() {
synchronized(this) {
}
}
https://www.logicbig.com/tutorials/core-java-tutorial/java-multi-threading/java-intrinsic-locks.html