[Javascript] Wait for a delayed function to end to start another...
Mike Dougherty
mdougherty at pbp.com
Wed Jan 24 12:58:41 CST 2007
wouldn't the concurrent calls only be a problem if the target were the same object? So if there
is no need for the semaphore to block two different objects, the global variable you mentioned
could be a property value set on the object itself. With that strategy, the delayed functions
could check their respective objects' semaphore and either cancel self, or cancel pending action
and replace with self. This allows two different objects to have delayed actions without
interfering with each other. (though I question the value of an intentially delayed user
experience, but that's another issue)
On Wed, 24 Jan 2007 11:46:38 -0700
"Peter Brunone" <peter at brunone.com> wrote:
>
> What about another global variable that flips before when you call setTimeout, and resets when
>the function actually runs?
More information about the Javascript
mailing list