how to stop thread running at middle of function?
I want to run two functions in parallel,both functions are recursive and they use common variables, so in each iteration they need other function...