$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Olaf van der Spek (olafvdspek_at_[hidden])
Date: 2006-03-03 17:37:00
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.