Do not use TerminateLanes, because it can lead to unexpected behaviour if a called procedure is terminated by its caller. TerminateLanes can be replaced by code that modifies some variable to indicate that the parallel lanes should terminate. The parallel lanes should check this variable regularly and terminate in an orderly fashion.