I am trying to get a reference to the main boost::thread of execution, so that I can interrupt it. However, boost::thread doesn't seem to supply any way of doing this.
I have searched on the internet but I can't seem to find an answer to this question.
I did see some old answers, but they seem to be relevant to old boost code.
The closest one said that using boost::thread t;
(the default constructor) will give me a reference to the current thread. However, the boost documentation seems to say that that will create a reference to a not-a-thread.
My main goal is to interrupt the main thread, and not get a reference to the current boost::thread, but that seemed like the easiest way.
My current solution is to create a new thread from main, and just join() it. Is there any way to get the current thread object (or interrupt it) and not use this workaround?
Thanks