title: Java : How to stop a Thread that's calling a succession of C++ functions using a JNI function?
body: <p>So, here is my situation :</p>
  
  <p>I've got a Java application that is sending arrays of data to a C++ DLL using a JNI method from a "JavaToCpp" class.</p>
  
  <p>Once the C++ DLL have received all the data, it begins performing several actions on it.</p>
  
  <p>I'm running the "JavaToCpp" class using a new thread, for my Java interface not to be frozen during the (long) (C++) procedures/subroutines.</p>
  
  <p>I implemented two methods to stop the working (C++) procedures/subroutines : </p>
  
  <ul>
  <li>The first one "STOP" : is creating a file which is going to be read by the C++ DLL so it can cleanly stop the running procedures/subroutines.</li>
  <li>The second one "KILL" : is supposed to shutdown / kill the running C++ procedures/subroutines directly</li>
  </ul>
  
  <p>The problem is that, after looking for a while, I did not find any good trick to perfom it.</p>
  
  <p>So if anyone's got an idea on how to kill a Thread while procedures/subroutines are being running ...</p>