diff lisp/itimer.el @ 2284:17dfe8e3aead

[xemacs-hg @ 2004-09-20 18:11:33 by james] Katsumi's fix to make itimers wake up at the right time.
author james
date Mon, 20 Sep 2004 18:11:33 +0000
parents 023b83f4e54b
children 914c5afaac33
line wrap: on
line diff
--- a/lisp/itimer.el	Mon Sep 20 18:00:39 2004 +0000
+++ b/lisp/itimer.el	Mon Sep 20 18:11:33 2004 +0000
@@ -406,6 +406,14 @@
 	(error "itimer named \"%s\" already existing and activated"
 	       (itimer-name itimer))))
   (let ((inhibit-quit t))
+    (if itimer-timer
+	;; Modify the itimer timeout value as if it were begun
+	;; at the last time when the itimer driver was woken up.
+	(set-itimer-value
+	 itimer
+	 (+ (itimer-value itimer)
+	    (itimer-time-difference (current-time)
+				    itimer-timer-last-wakeup))))
     ;; add the itimer to the global list
     (setq itimer-list (cons itimer itimer-list))
     ;; If the itimer process is scheduled to wake up too late for