title: C++ std::thread of a member function
body: <p>I'm trying to program a command line server that would receive information from a serial port, parse it, and record it in an internal object.</p>
  
  <p>Then upon request from a client the server would return the requested information.</p>
  
  <p>What I want to do is put the receiver &amp; parser parts in a separated thread in order to have the server running along side, not interfering with the data collection.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  
  class exampleClass{
      std::thread *processThread;
  
      public void completeProcess(){
          while(1){
              processStep1();
              if (verification()){processStep2()}
          }
      };
  
      void processStep1(){...};
      void processStep2(){...};
      bool verification(){...};
      void runThreaded();
  } // End example class definition
  
  // The idea being that this thread runs independently
  // until I call the object's destructor
  
  exampleClass::runThreaded(){
      std::thread processThread(&amp;exampleClass::completeProcess, this);
  } // Unfortunately The program ends up crashing here with CIGARET
  </code></pre>