title: Can you run a thread in another thread?
body: <p>In my programm, I want to run two seperate thread, which are initalized and launched in the main thread. This concept works fine for me, but when I now have to make a cooldown on one of the child threads while it is not paused it seems to still pause the thread;</p>
  
  <p>Think of this as an example:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  
  class testClass {
      static void grandchild();
      static void child();
  public:
      void parent();
  };
  
  void testClass::grandchild() {
      //infinite loop of nothing;
      while (true);
  }
  
  void testClass::child() {
      //thread initalising and 
      std::thread grand(&amp;testClass::grandchild);
      std::cout &lt;&lt; "before join" &lt;&lt; std::endl;
      grand.join();
      std::cout &lt;&lt; "after join" &lt;&lt; std::endl;
  }
  
  void testClass::parent() {
      std::thread child(&amp;testClass::child);
      child.join();
  }
  int main() {
      testClass parentclass;
      parentclass.parent();
  }
  </code></pre>
  
  <p>The output of this program now is </p>
  
  <p><a href="https://i.stack.imgur.com/emAmm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/emAmm.png" alt="http://puu.sh/ppTkR/e29221e1b8.png"></a></p>
  
  <p>This also happens when I do this_thread::sleep_for and other functions which pause a thread. Can anyone explain me why this happens and what is possible for me to implement this properly or if this is even possible in C++?</p>