A possible race condition
Posted: Tue May 12, 2015 4:29 pm
I have a program that uses long running loops. Within these loops, I''m copying one buffer into another, byte by byte. There are times that I may need to abort the operation so I created an "Abort Button". Within these loops I also have a test so that every 1000th time through the loop the program updated a progress bar. Right after updating the progress bar, I'm checking on whether the abort button has been pushed. If it has, then the index on the loop is modified to terminate the loop.
I'm running into a problem in that clicking on the abort button is not registering while the loop is running. In other words, it appears that the interrupt from the mouse click isn't triggered. I tested this by putting an "answer message" into the mouseUp handler for the abort button. It doesn't appear to get triggered while the program is in one of the loops (there are three of them). This appears to be a race condition (a problem with system priority).
I'm using LiveCode version 7.0.3 under a Windows 7 operating system.)
Please advise!
I'm running into a problem in that clicking on the abort button is not registering while the loop is running. In other words, it appears that the interrupt from the mouse click isn't triggered. I tested this by putting an "answer message" into the mouseUp handler for the abort button. It doesn't appear to get triggered while the program is in one of the loops (there are three of them). This appears to be a race condition (a problem with system priority).
I'm using LiveCode version 7.0.3 under a Windows 7 operating system.)
Please advise!