how to differentiate between two threads

Posted by mithun1538 on Stack Overflow See other posts from Stack Overflow or by mithun1538
Published on 2010-04-05T10:00:56Z Indexed on 2010/04/05 10:03 UTC
Read the original article Hit count: 214

Filed under:
|
|

Hello everyone,

I have the following code in my program:

Thread getUsersist, getChatUsers;

getUsersList = new Thread(this, "getOnlineUsers");
getUsersList.start();
getChatUsers = new Thread(this, "getChatUsers");
getChatUsers.start();

In run(), I wish to know which thread is using run(). If its "getOnlineUsers" i will do something, If it is "getChatUsers" I will do something else. So how do I know which thread is using run()?

© Stack Overflow or respective owner

Related posts about threads

Related posts about multithreading