Thread._wait_for_tstate_lock() never returns
问题 My program appears to run in a deadlock sometimes when I hit Ctrl+C. I'm trying to catch the keyboard interrupt and gracefully stop all running threads, but I'm not quite there yet. I'm using a concurrent.futures.ThreadPoolExecutor . To find the location of the deadlock, I'm using the this receipe from ActiveState. Now, here's the full stacktrace: # ThreadID: 4856 File: "c:\users\niklas\appdata\local\programs\python\python36\lib\threading.py", line 884, in _bootstrap self._bootstrap_inner()