If I call start() on thread A, causing it to run, and then call start() again while it’s still running, what happens?
Example:
myThread.start();
// myThread is running...
myThread.start();
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.
An IllegalThreadState exception will be thrown. There is no way to get a thread back to the “waiting to be started” state after it has been started, so whatever the state the thread is in after the first
start, it will be in the wrong state for the second one.