Terminate current thread in destructor
<p>In a project we're creating multiple statemachines in a wrapper-class. Each wrapper runs in it's own thread. When the jobs is done, the wrapper-class destructor is being called, and in there we would like to stop the thread.</p>

<p>Though if we're using <code>thread.join()</code>, we get a deadlock (since it tries to join itself). We could somehow signal another thread, but that seems a bit messy. </p>

<p>Is there any way to properly terminate the thread in which a class is running in, upon object destruction?</p>