X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a0ecb2ac8eb6d2e72f255fe8e4acb607486d6c1d..61e1d1ca4f04460699287e66a57e722328a641be:/src/atimer.c?ds=sidebyside diff --git a/src/atimer.c b/src/atimer.c index 7e78bdad9c..8b092270d7 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -1,5 +1,6 @@ /* Asynchronous timers. - Copyright (C) 2000, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -15,8 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include #include @@ -231,7 +232,7 @@ stop_other_atimers (t) struct atimer *p, *prev; /* See if T is active. */ - for (p = atimers, prev = 0; p && p != t; p = p->next) + for (p = atimers, prev = NULL; p && p != t; prev = p, p = p->next) ; if (p == t) @@ -364,6 +365,8 @@ alarm_signal_handler (signo) { EMACS_TIME now; + SIGNAL_THREAD_CHECK (signo); + EMACS_GET_TIME (now); pending_atimers = 0; @@ -375,7 +378,9 @@ alarm_signal_handler (signo) t = atimers; atimers = atimers->next; +#ifndef MAC_OSX t->fn (t); +#endif if (t->type == ATIMER_CONTINUOUS) { @@ -387,11 +392,16 @@ alarm_signal_handler (signo) t->next = free_atimers; free_atimers = t; } +#ifdef MAC_OSX + /* Fix for Ctrl-G. Perhaps this should apply to all platforms. */ + t->fn (t); +#endif EMACS_GET_TIME (now); } - set_alarm (); + if (! pending_atimers) + set_alarm (); }