recently, I noticed that my code randomly causes Segmentation Fault errors. But I think that my code is pretty simple so far and I cant figure out wh
It looks as if you're unlocking your termination_in_process mutex from your main process - even though it was locked by another thread - which is undefined behavior. It might work, and it might not work.
A solution could be to use a FIFO buffer (for instance a std::queue, or even just a std::vector) and push the thread id of your terminated threads to it in your Exit() function, then send out your signal, and let the main thread go through the buffer and join any threads in it.
If Exit() isn't called at the point of your segfault this shouldn't be the reason for your problem though, but it's still something you might want to fix.