R
Richard Maher
Hi,
Can someone please clarify the behaviour of clearTimeout for me?
If the timer has (in search of correct terminology here) elapsed, fired, is
pending, but the function specified with setTimeout cannot be delivered
because the EDT is busy on another event that is attempting to cancel the
previous timeout - will the timeout function still be executed?
IOW, the timer itself has expired, the cancel was too late, but the function
has yet to be delivered as it is presumably sitting in the stack somewhere,
and the currently executing function says clearTimeout. Is it smart enough
to prevent delivery of the setTimeout function or do I have to incorporate
some sort of amDying flag for the timeout function to see and then
exit/abort?
I'm guessing that clearTimeout is not that clever and the
anDying/shuttingDown flag is a requirement but I had thought (at least in ye
olde days) that a cancelTimeout was effectual until the function had been
delivered.
Cheers Richard Maher
Can someone please clarify the behaviour of clearTimeout for me?
If the timer has (in search of correct terminology here) elapsed, fired, is
pending, but the function specified with setTimeout cannot be delivered
because the EDT is busy on another event that is attempting to cancel the
previous timeout - will the timeout function still be executed?
IOW, the timer itself has expired, the cancel was too late, but the function
has yet to be delivered as it is presumably sitting in the stack somewhere,
and the currently executing function says clearTimeout. Is it smart enough
to prevent delivery of the setTimeout function or do I have to incorporate
some sort of amDying flag for the timeout function to see and then
exit/abort?
I'm guessing that clearTimeout is not that clever and the
anDying/shuttingDown flag is a requirement but I had thought (at least in ye
olde days) that a cancelTimeout was effectual until the function had been
delivered.
Cheers Richard Maher