I am stuck with one question.
I have one main thread which spawns a child thread.
now main thread is calling some X () function and child thread is busy in some other function(pinging tomcat in infinite loop).
When my main thread comes back from X() the child thread should also terminate from its function then and there only.
Is there any way out.For time being I am using flag to do the same but there must be some way to do it at thread level.