The current thread receives a lock on the corresponding instance of the MyThread class.
synchronized(this) locks the same object as synchronized(m) in main() .
Finally,
public void run() { synchronized (this) {
exactly equivalent
public synchronized void run() {
source share