title: How to "stop" detached thread which is waiting on a condition variable?
body: <p>I detach a thread from Class <code>B</code>:</p>
  
  <pre><code>t1 = std::thread(&amp;Class::method, this);
  t1.detach();
  </code></pre>
  
  <p>which as part of it's normal operation waits on a condition variable:</p>
  
  <pre><code>cv.wait(lock);
  </code></pre>
  
  <p>However, when I close my B application the detached thread remains. How do I stop/clean-up this thread when <code>B::~B()</code> is called?</p>