From: Matt Birkholz Date: Fri, 11 Dec 2015 17:25:06 +0000 (-0700) Subject: edwin: Eliminate redundant thread event when setting run-light. X-Git-Tag: mit-scheme-pucked-9.2.12~376^2~12 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=96e501c9c4b9902ed69e5d45e087ee271c53208f;p=mit-scheme.git edwin: Eliminate redundant thread event when setting run-light. 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. --- diff --git a/src/edwin/editor.scm b/src/edwin/editor.scm index 9df9c33ee..1a25f9d44 100644 --- a/src/edwin/editor.scm +++ b/src/edwin/editor.scm @@ -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) diff --git a/src/edwin/intmod.scm b/src/edwin/intmod.scm index 911fa6b2d..e868424c8 100644 --- a/src/edwin/intmod.scm +++ b/src/edwin/intmod.scm @@ -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)))