Is there any place to hook up when a Thread has been killed? Something like :
onDestroy{
//do something...
}
EDIT:
Sorry. I should have stated it more clearly.
The thread termination is not because all the job has done but because it has been killed by the client code using ThreadGroup.destroy(). As my singleton is being instantiated in the client code, so it will belong to the THreadGroup of the Client code and be killed as a result. (Actually, I am not very sure of the last sentence…)
You can wrap both the action and the hook like this.
and