27 Apr
2007
27 Apr
'07
5:15 p.m.
I've got a singleton object that is trying to run its operator() method in a separate thread, but I'm getting a segfault when I construct the thread object: PublishedListener::PublishedListener(string directory) { _thread = new thread(*this); // segfault here } PublishedListener.h: class PublishedListener { public: static PublishedListener &getInstance(); void run(); void operator()(); boost::filesystem::path getItemDirectory(); virtual ~PublishedListener(); private: PublishedListener(std::string directory); static PublishedListener *_instance; boost::thread *_thread; boost::filesystem::path *itemDirectory; }; Thanks in advance!