Are timers running, while loops are active?

喜你入骨 提交于 2019-12-11 12:18:01

问题


Here's my code:

setTimer(delay, (SEEDKEY_MAXTRY * SEEDKEY_FREQ) + (LOGIN_MAXTRY * LOGIN_FREQ));
do {
    // waits, until all operations have been executed;  
} while(isTimerActive(delay));

I know exactly how long it takes to execute my commands, so I set the timer delay to the explicit value. I have to wait, until I return some values.

The simulation stucks at this point, my panels go into Windows-"No response" and the only way I can end the simulation is via Taskmanager.

I think the only explanation is, that the timers need more time, or are not executed at all, while I am in the do ... while statement. (same with while {})

Can someone confirm this thought, or prove me wrong by giving me a solution to my problem?


回答1:


Ok I always find a workaround, since CAPL is not too popular on stackoverflow...


For the readers, that want to know how:

I just used a global status variable to restrict the user from performing the action until my processing gets finished.



来源:https://stackoverflow.com/questions/38048777/are-timers-running-while-loops-are-active

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!