edwin: Eliminate redundant thread event when setting run-light.
authorMatt Birkholz <puck@birchwood-abbey.net>
Fri, 11 Dec 2015 17:25:06 +0000 (10:25 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Sun, 3 Jan 2016 20:06:12 +0000 (13:06 -0700)
Using inferior-thread-output! in wait-for-input's thread event signals
another thread event unnecessarily.  The new inferior-thread-run-
light! just sets the flags.

src/edwin/editor.scm
src/edwin/intmod.scm

index 9df9c33eef4e32ae4f4804ebeb65d174c5de0e41..1a25f9d440f793e1fb8040fb76e20f18a7e0112e 100644 (file)
@@ -607,6 +607,11 @@ TRANSCRIPT    messages appear in transcript buffer, if it is enabled;
        (set! inferior-thread-changes? #t)
        (signal-thread-event editor-thread #f))))
 
+(define (inferior-thread-run-light! flags)
+  (set-car! flags #t)
+  (if (not inferior-thread-changes?)
+      (set! inferior-thread-changes? #t)))
+
 (define (accept-thread-output)
   (with-interrupt-mask interrupt-mask/gc-ok
     (lambda (interrupt-mask)
index 911fa6b2dac8c8d11bd5b4c001cd50d107c2d5c8..e868424c80d56350aec498dfd7090a3fb842da27 100644 (file)
@@ -226,9 +226,7 @@ evaluated in the specified inferior REPL buffer."
                   (string-append " [level: " (number->string level) "]")))
         buffer)
        (set-run-light! buffer #f)
-       ;; This doesn't do any output, but prods the editor to notice
-       ;; that the modeline has changed and a redisplay is needed.
-       (inferior-thread-output! (port/output-registration port)))))
+       (inferior-thread-run-light! (port/output-registration port)))))
   (do () ((ready? port))
     (suspend-current-thread)))