inside qthread contructor, copy just the following and you are good to go.
mThread = new boost::thread(bind(&qthread::Execute, this));
Date: Fri, 15 Apr 2011 11:06:56 +0100
From: sfx810@googlemail.com
To: boost-users@lists.boost.org
Subject: [Boost-users] [thread] : pause/resume thread
Hi All, I have just started learning boost. I want my thread to support following functions
Pause();
Resume();
Stop();.
I have come up with following code, which ends up as dead lock. Can some one please guide me as how to achieve the desired functionality.
Would really appreciate any help.
Thanks.
Kaz
class qthread
{
public:
boost::thread* mThread;
boost::condition_variable mCond;
boost::mutex mMutex;
bool mExit;
qthread(): mExit(false)
{
// create function pointer to local Execute function
boost::function