From 96e501c9c4b9902ed69e5d45e087ee271c53208f Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 11 Dec 2015 10:25:06 -0700 Subject: [PATCH] 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. --- src/edwin/editor.scm | 5 +++++ src/edwin/intmod.scm | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) 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))) -- 2.25.1