title: Using a boost thread: Signal and wait for termination
body: <p>i'm currently writing a c/c++ dll for later use mostly in Delphi and i'm more familiar with threads in Delphi than c/c++ and especially boost. So i wonder how i can achieve the following scenario?</p>
  
  <pre><code>class CMyClass
  {
      private:
          boost::thread* doStuffThread;
      protected:
          void doStuffExecute(void)
          {
              while(!isTerminationSignal()) // loop until termination signal
              {
                  // do stuff
              }
  
              setTerminated(); // thread is finished
          };
      public:
          CMyClass(void)
          {
              // create thread
              this-&gt;doStuffThread = new boost::thread(boost::bind(&amp;CMyClass::doStuffExecute, this));
          };
  
          ~CMyClass(void)
          {
              // finish the thread
              signalThreadTermination();
              waitForThreadFinish();
  
              delete this-&gt;doStuffThread;
  
              // do other cleanup
          };
  }
  </code></pre>
  
  <p>I have red countless articles about boost threading, signals and mutexes but i don't get it, maybe because it's friday ;) or is it not doable how i think to do it?</p>
  
  <p>Regards
  Daniel</p>