Myrunnable r1 = new Myrunnable();
Thread t1 = new Thread(r1);
Thread t2 = new Thread(r1);
t1.start();
t2.start();
I know r1 is the job that workers (t1 & t2) are supposed to perform.Also, if t1 will enter synchronized method, t2 will have to wait and vice versa.
What I don't know is which object we are talking about? Are we talking about getting a lock on object r1?