all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* C-g doesn't quit (while t) on Solaris 8
@ 2009-04-28  2:16 YAMAMOTO Mitsuharu
  2009-04-28  3:06 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: YAMAMOTO Mitsuharu @ 2009-04-28  2:16 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-28 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28  2:16 C-g doesn't quit (while t) on Solaris 8 YAMAMOTO Mitsuharu
2009-04-28  3:06 ` Stefan Monnier
2009-04-28  4:08   ` YAMAMOTO Mitsuharu
2009-04-28 12:44     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.