Yannick Wald
Yannick Wald

Reputation: 195

What is the state after a Thread crashed?

I am holding a list of Threads, each associated with a Runnable. After running them for a while, some of them changed into the state TERMINATED, though they shouldn't because of while(true) implemented in run(). So I guess those are crashed, am I right?

edit: each thread is independent from the others.

Upvotes: 0

Views: 100

Answers (1)

Brian Agnew
Brian Agnew

Reputation: 272257

They may have thrown an exception themselves, or been interrupted by another thread. I assume that there's no flow control you've implemented to jump out of the while loop (via an exception) and then cleanly complete processing.

Upvotes: 1

Related Questions