Can I stop JavaScript function execution via global variables?
<p>So I read through <a href="http://stackoverflow.com/questions/680021/is-it-possible-to-stop-execution-in-javascript-jquery">this</a> a bit, and it looks like JavaScript functions can't be explicitly killed off mid-run. What if I have a global variable, <code>window.currentlyProcessing</code> that manages this.</p>

<pre><code>function contentsChanged()
{
    if( window.curentlyProcessing == true )
    {
        return;
    }
    window.curentlyProcessing = true;
    // DO STUFF
    window.curentlyProcessing = false;
}
</code></pre>

<p>Since <code>contentsChanged</code> gets called a lot, will this effectively stop it from running over itself?</p>
