title: What happens when you call a method in a thread that is already working?
body: <p>Running my test code below it appears that calling a threads method while it is still executing runs the method between the threads current execution.
  What I'm wondering is what is exactly happening?</p>
  
  <p>Does the thread pause the while loop, execute the method, and then go back to the loop? Does it do so at the end of the while code or anywhere in between?</p>
  
  <p>Or does the method execute in another separate thread? Or something else altogether?</p>
  
  <pre><code>package test;
  
  public class main {
      public static threed thred = new threed();
  
      public static void main(String[] args) throws InterruptedException {
          thred.start();
          Thread.sleep(10000);
          while (true) {
              System.out.println("doing it");
              thred.other();
              Thread.sleep(2000);
              thred.x++;
          }
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>package test;
  
  public class threed extends Thread {
      public int x;
  
      public threed() {
          x = 0;
      }
  
      public void run() {
          while (x &lt; 10) {
              System.out.println(x);          
          }   
      }
  
      public void other() {
          System.out.println("other " + x);
      }
  }
  </code></pre>