I have a thread call myThread
.
public class MyThread extends Thread {}
Now I put myThread
to the constructor of Thread
.
MyThread myThread = MyThread();
Thread thread= new Thread(myThread, "myThread");
So when I call thread.start()
, it will evoke the run method of myThread
.
When myThread
run method is still running, I checked myThread.isAlive()
. It returns false but thread.isAlive()
returns true.
Why myThread.isAlive()
is returning false?