Let's say we have the parent thread Tp which starts two child threads Tc1 and Tc2 in the same order and waits for Tc2 to join (Tc2.join()).
Tc2: It starts and waits for the user input by invoking a shell. Tc1: It starts and runs a time counter and after a specified time if no input is given by the user in Tc2 child thread, it stops the shell started by the Tc2.
Now the problem is that the parent thread remains in waiting state for Tc2 to join and the process remains hanged.
How can Tc1 terminate the Tc2 (which is in user input waiting state) so that parent thread Tp can continue?
Browsed a lot but could not get the break through.