import time, concurrent.futures pool = concurrent.futures.ThreadPoolExecutor() pool.submit(time.sleep, 1000) print(1) pool.shutdown(wait=False) print(2)