According to the question:
1.T2 do task1
2.T1 do task1 while T2 do task2
3.T1 do task2
~If T1 should exit task1 as soon as T2 finished task2, no matter whether task1 of T1 is completed, then T2 should send a signal to T1 as command.
~If step 3 starts after both T1's task1 and T2's task2 is completed, then you might need another signal