|
From: | Adrian Robert |
Subject: | Re: Pretest next week |
Date: | Wed, 28 Jan 2009 21:25:38 +0200 |
On Jan 28, 2009, at 7:40 PM, Stefan Monnier wrote:
As it turns out, this isn't needed. SIGALRM is triggeringalarm_signal_handler() in atimer.c correctly, but run_timers() never gets called under SYNC_INPUT. I don't fully understand why or where the problem is here. But undefining SYNC_INPUT gets poll_for_input() called (and henceCtrl-g detected) even in tight loops, with no ill effects so far.I wrote SYNC_INPUT specifically for X11 input handling. From what you say above, there is apparently a bug in the way it handles SIGALRM. Apparently the QUIT macro should check pending_atimers somehow.
Yes, adding else if (pending_atimers) \ do_pending_atimers(); \at the end of QUIT allows poll_timer() to fire under SYNC_INPUT and Ctrl-g to be detected, with no apparent other ill effects (in very limited testing).
If so, we should probably create a new var `pending_signals', which should always reflect "pending_timers || interrupt_input_pending"
I'm not sure if the extra 0-comparison would significantly add to overhead but I guess code size could take a hit. Though maybe the part of QUIT above (when there is a quit_flag) could also be reduced to a function call to slim things down?
[Prev in Thread] | Current Thread | [Next in Thread] |