[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pretest next week

From: Adrian Robert
Subject: Re: Pretest next week
Date: Wed, 28 Jan 2009 18:24:00 +0200

On Jan 28, 2009, at 4:08 PM, Stefan Monnier wrote:

might be simpler if there's any way to get the conventional keyboard.c
timer-driven input polling done through the  QUIT macro under NS.

There is no such thing as a timer-driven polling in the QUIT macro.
The polling done via the QUIT macro is "polling for some C var to
change", not "polling for some external thingy".

Right. The polling I meant was running poll_for_input() in keyboard.c in response to the atimer 'poll_timer' firing, if running in polling mode (Fset_input_interrupt_mode(Qnil)). I wasn't sure if atimers just weren't supposed to be called while tight loops are running, or if some code just wasn't working as expected under NS. My initial thought was to add something like


to QUIT under HAVE_NS.

As it turns out, this isn't needed. SIGALRM is triggering alarm_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 hence Ctrl-g detected) even in tight loops, with no ill effects so far. Patch below.

It would be of interest to find out why it fails under the SYNC_INPUT case...

I also investigated the SIGIO thing a bit more. I can trigger the handler using kill -IO from the command line. But no SIGIO seems to be being sent to the process when keyboard input is given.


*** configure.in.~1.583.~       Thu Jan 22 15:08:19 2009
--- configure.in        Wed Jan 28 17:47:55 2009
*** 2096,2101 ****
--- 2096,2103 ----
    # We also have mouse menus.
+   # SYNC_INPUT prevents Ctrl-g detection in many cases.
+   AC_DEFINE(SYNC_INPUT, 0, [Process async input synchronously.])

*** nsterm.m.~1.53.~    Sun Jan 25 21:23:24 2009
--- nsterm.m    Wed Jan 28 17:19:50 2009
*** 3746,3752 ****
------------------------------------------------------------------------ -- */
    baud_rate = 38400;
!   Fset_input_interrupt_mode (Qt);

--- 3763,3769 ----
------------------------------------------------------------------------ -- */
    baud_rate = 38400;
!   Fset_input_interrupt_mode (Qnil);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]