Boost logo

Boost :

From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2008-01-25 10:25:33


hp.shen_at_[hidden] wrote:

I can't see exactly why you get an error, but here are some observations:

> ThreadWrapper(unsigned delySec=0)
> {
> delySec = delySec;

I think you meant m_delySec = delySec.

> m_pause = false;
> m_stop = false;
> }

What's wrong with:

ThreadWrapper(unsigned delaySec=0):
   m_stop(false),
   m_pause(false),
   m_delaySec(delaySec)
{}

> virtual void stop()
> {
> boost::mutex::scoped_lock lock(m_mutex);
> m_stop=true;
> m_cond.notify_one();

Maybe you want to join the thread here?

> }

Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk