Part of lp.services.timeout View In Hierarchy
This will execute the function in a separate thread. If the function doesn't complete in the timeout, a TimeoutError is raised. The clean-up function will be called to "stop" the thread. (If it's possible to do so.)