As in the Thread.State is RUNNING and I set the Thread reference to null immediately after I start the thread
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As already stated in the other question’s answers, the thread would not be garbage collected.
By definition, an object is only elligible for garbage collection if it is not reachable by any live thread – and I’d consider a thread in running state a live thread. 🙂
From the Java 7 Spec (12.6.1):
And internally I’m sure some part of the JVM still has a reference to that thread, the scheduler for example.