Here's the situation:
I have multiple 'onchange' handlers setup that all update a common variable (build a url string with parameters that changed)
I also have a timer function that wakes up every X minutes and uses the url built by onchange handlers to send an update request to the server, after which it empties out the url variable.
So obviously there are some concurrency issues here - what if two onchange handlers fire at the same time, or the timer function fires as the onchange handler is executing.
What is the best way to deal with that?
I have multiple 'onchange' handlers setup that all update a common variable (build a url string with parameters that changed)
I also have a timer function that wakes up every X minutes and uses the url built by onchange handlers to send an update request to the server, after which it empties out the url variable.
So obviously there are some concurrency issues here - what if two onchange handlers fire at the same time, or the timer function fires as the onchange handler is executing.
What is the best way to deal with that?