3 Mar
2006
3 Mar
'06
10:37 p.m.
Hi, I'm converting code using pthreads to boost::thread. I've now got this code: Cdns_worker::Cdns_worker(): m_run(true), m_thread(boost::bind(&Cdns_worker::run, this)) { // pthread_cond_init(&m_condition, NULL); // pthread_mutex_init(&m_mutex, NULL); // pthread_create(&m_thread, NULL, Cdns_worker::run, this); } The data the thread is using is in Cdns_worker, but it seems impossible to delay the thread creation until the end of the constructor, like I could with pthreads. What should I do in this case? I also noticed boost::thread has a default constructor but it's not copyable. What is the purpose of this default constructor? And are there any boost::thread examples? I couldn't find them in the documentation.