mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-06 22:12:47 -05:00
Only run one toplevel callback per event loop iteration.
This change attempts to reinstate as a universal property something which was sporadically true of the ad-hockery that came before toplevel callbacks: that if there's a _very long_ queue of things to be done through the callback mechanism, the doing of them will be interleaved with re-checks of other event sources, which might (e.g.) cause a flag to be set which makes the next callback decide not to do anything after all. [originally from svn r10040]
This commit is contained in:
@ -493,7 +493,9 @@ int do_eventsel_loop(HANDLE other_event)
|
||||
int skcount;
|
||||
unsigned long now = GETTICKCOUNT();
|
||||
|
||||
if (run_timers(now, &next)) {
|
||||
if (toplevel_callback_pending()) {
|
||||
ticks = 0;
|
||||
} else if (run_timers(now, &next)) {
|
||||
then = now;
|
||||
now = GETTICKCOUNT();
|
||||
if (now - then > next - then)
|
||||
|
Reference in New Issue
Block a user