In my program I have a static object that creates a boost::thread. The thread is supposed to run until program termination, but it shouldn't be terminated in random state, so I implemented controled thread termination in this static object's destructor. The problem is that when main() terminates my thread is terminated before the destructor is called.
Now the question: is it possible to prevent the thread to be destroyed? Or at least delay it, so that it happens after the destructor is called?