How does a Java thread behave when a method is accessed externally?
<p>Suppose I have the following thread:</p>

<pre><code>public class MyThread {
    public void run() {
        while (true) {
            // do something forever
        }
    }
}
</code></pre>

<p>Then I instantiate the thread as follows:</p>

<pre><code>MyThread thread = new MyThread();
</code></pre>

<p>What happens if I now call</p>

<pre><code>thread.performSomeFunction()
</code></pre>

<p>Specifically, how does performSomeFunction interact with the infinite loop above?  Does it have to wait for the loop to sleep?  Or can they both run "concurrently"?</p>
