From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: emacs-devel@gnu.org
Subject: C-g doesn't quit (while t) on Solaris 8
Date: Tue, 28 Apr 2009 11:16:51 +0900 [thread overview]
Message-ID: <wlk555wmi4.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
As Solaris 8 doesn't have SIGIO, Emacs uses polling with SIGALRM so it
can quit even a tight loop. But Emacs 23 on Solaris 8 with X11
doesn't quit the evaluation of (while t). It used to work on Emacs 22.
The difference between two versions is in a condition (see XXX in the
comment in line 2253) in start_polling (keyboard.c).
2249 void
2250 start_polling ()
2251 {
2252 #ifdef POLL_FOR_INPUT
2253 /* XXX This condition was (read_socket_hook && !interrupt_input),
2254 but read_socket_hook is not global anymore. Let's pretend that
2255 it's always set. */
2256 if (!interrupt_input)
2257 {
2258 /* Turn alarm handling on unconditionally. It might have
2259 been turned off in process.c. */
2260 turn_on_atimers (1);
2261
2262 /* If poll timer doesn't exist, are we need one with
2263 a different interval, start a new one. */
2264 if (poll_timer == NULL
2265 || EMACS_SECS (poll_timer->interval) != polling_period)
2266 {
2267 EMACS_TIME interval;
2268
2269 if (poll_timer)
2270 cancel_atimer (poll_timer);
2271
2272 EMACS_SET_SECS_USECS (interval, polling_period, 0);
2273 poll_timer = start_atimer (ATIMER_CONTINUOUS, interval,
2274 poll_for_input, NULL);
2275 }
2276
2277 /* Let the timer's callback function poll for input
2278 if this becomes zero. */
2279 --poll_suppress_count;
2280 }
2281 #endif
2282 }
This function is called from init_keyboard both at the dump stage and
in the dumped executable:
11610 void
11611 init_keyboard ()
11612 {
11683 #ifdef POLL_FOR_INPUT
11684 poll_suppress_count = 1;
11685 start_polling ();
11686 #endif
11687 }
In Emacs 22, the call to start_polling doesn't do anything at the dump
stage because read_socket_hook is not set yet. But In Emacs 23, it
starts a timer even at the dump stage and sets the variable poll_timer
to non-NULL, and that prevents the dumped executable from setting an
effective poll_timer (line 2264).
Perhaps we should suppress the call to start_polling at the dump
stage?
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
next reply other threads:[~2009-04-28 2:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 2:16 YAMAMOTO Mitsuharu [this message]
2009-04-28 3:06 ` C-g doesn't quit (while t) on Solaris 8 Stefan Monnier
2009-04-28 4:08 ` YAMAMOTO Mitsuharu
2009-04-28 12:44 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlk555wmi4.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).