Implement long-running task protection, timeouts, and Task start/stop thread safety.