title: Thread.join() and Thread.interrupt() doesn't stop the thread
body: <p>I'm having some issues with stopping my threads.<br>
  I've tried calling both <code>Thread.join()</code> and <code>Thread.interrupt()</code>, alone and together, but I can't get it working.<br>
  I have a <code>while</code> loop in each class, which runs as long as a boolean called <code>running</code> equals to <code>true</code>.<br>
  I then stop the program by calling a method called <code>stop</code>. The <code>stop</code> method only sets <code>running</code> to false, so that the while loop exits.  </p>
  
  <p><strong>EDIT</strong> Code:</p>
  
  <pre><code>public class Game implements Runnable {
  
      // The Thread
      private Thread thread;
  
      // The program's running state
      private boolean running = false;
  
      // Create the Thread and the rest of the application
      public void create() {
          // Create the Thread
          thread = new Thread(this, "Game");
          // Start the Thread
          thread.start();
          // Set the program's running state to true
          running = true;
      }
  
      public void run() {
          while(running) {
              // Render, update etc...
          }
  
          // When the while loop has exited
          // (when running is false (when the stop method has been called))
          try {
              // Join the thread
              thread.join();
              // Interrupt the thread
              thread.interrupt();
          } catch(InterruptedException e) {
              // Print the exception message
              e.printStackTrace();
          }
          // Exit the program
          System.exit(0);
      }
  
      // Stop the game
      public void stop() {
          // Set the program's running state to false
          running = false;
      }
  
      // The main method
      public static void main(String[] args) {
          // Create a new instance of Game and start it
          new Game().create();
      }
  </code></pre>