How locks obtained in multithreading and on which object?

Posted by Abhishek Jain on Stack Overflow See other posts from Stack Overflow or by Abhishek Jain
Published on 2010-04-24T18:40:44Z Indexed on 2010/04/24 18:43 UTC
Read the original article Hit count: 172

Filed under:
|
|

Class ThreadTest extends Thread{

public synchronised void run(){

}

public static void main(String args[]) { Thread t1=new ThreadTest(); Thread t2=new ThreadTest(); t1.start(); t2.start(); } }

I want to know in above scenario, how locks obtained and on which object?

Thanks, -Abhishek

© Stack Overflow or respective owner

Related posts about java

Related posts about multithreading