START-PROBE-FOLDER-THREAD is being called whenever a message is
authorChris Hanson <org/chris-hanson/cph>
Sat, 29 Sep 2001 03:00:13 +0000 (03:00 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 29 Sep 2001 03:00:13 +0000 (03:00 +0000)
selected, but unfortunately if there was already a thread, it was
being killed and a new one started, which generated network traffic on
an IMAP folder.  Now it doesn't do anything if there is already a
thread.

v7/src/imail/imail-top.scm

index fe8faea542ecb92d8b29eda7ae19bc7929af537c..6e307646a6a9d8b49aa761a58f2fe1d399183fa5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-top.scm,v 1.273 2001/09/28 15:35:11 cph Exp $
+;;; $Id: imail-top.scm,v 1.274 2001/09/29 03:00:13 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology
 ;;;
@@ -2241,17 +2241,19 @@ Negative argument means search in reverse."
 ;;;; Probe-folder thread
 
 (define (start-probe-folder-thread folder)
-  (stop-probe-folder-thread folder)
-  (without-interrupts
-   (lambda ()
-     (let ((interval (ref-variable imail-update-interval #f)))
-       (if interval
-          (store-property! folder
-                           'PROBE-REGISTRATION
-                           (start-standard-polling-thread
-                            (* 1000 interval)
-                            (probe-folder-output-processor
-                             (weak-cons folder unspecific)))))))))
+  (if (not (get-property folder 'PROBE-REGISTRATION #f))
+      (begin
+       (stop-probe-folder-thread folder)
+       (without-interrupts
+        (lambda ()
+          (let ((interval (ref-variable imail-update-interval #f)))
+            (if interval
+                (store-property! folder
+                                 'PROBE-REGISTRATION
+                                 (start-standard-polling-thread
+                                  (* 1000 interval)
+                                  (probe-folder-output-processor
+                                   (weak-cons folder unspecific)))))))))))
 
 (define ((probe-folder-output-processor folder))
   (let ((folder (weak-car folder)))