If thread is interrupted in java, I know we should set its flag back to interrupted, wrap up the things(any cleaning) and exit.
But I would like to know -
- What happens to that thread after that?
- Who should clear the status of the flag if it is one of the thread from thread pool and if I don't want to exit the application.
- I might want that thread to be cleaned or just kill that thread and create new clean thread? Or that thread is useless forever till application closes down?
- Does executor service or whoever created thread takes the responsibility and replace thread with new clean thread?