Also got rid of trailing white space. That corrupted .git/. Big ass-commit because of recovered .git directory.
A bool is set when a thread is terminated, which may help detect it. A cached version of the thread's pid is also kept around. And lastly, the thread is unsubscribed from events upon destruction.