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.