Add task global timeout function.