I have a thread controlled issue.
My problem is that I want to create a ThreadManager class that should manage the entire thread created and, of course, destroy this thread.
class DerivedInterface { public: DerivedInterface():id("Test"){}; virtual ~DerivedInterface(){}; virtual void run() = 0; virtual std::string getId() = 0; const std::string id ; }; class Object : public DerivedInterface { public: Object():id("VirtualDae"){}; ~Object(){} void run() { std::cout<<"i'M IN RUN"<<std::endl; bool flag = true; while(flag){
t1.interrupt or manager.stop returns a segmantation error.
Program terminated with signal 11, Segmentation fault. #0 0x00007f3e1d095993 in boost::thread::get_thread_info() const () from libboost_thread.so.1.51.0 (gdb) where #0 0x00007f3e1d095993 in boost::thread::get_thread_info() const () from libboost_thread.so.1.51.0 #1 0x00007f3e1d0965c6 in boost::thread::interrupt() () from libboost_thread.so.1.51.0 #2 0x00000000004088a9 in main ()
The boost :: thread pointer is not null, so what happens? Thank you in advance.
Whey Can't I do something like this?
boost::thread *t1 = new boost::thread(&DerivedInterface::run, &t);
source share