From 1d5031c3e6bb8f122d46a785f955e23612787ff9 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 31 Dec 2010 20:14:09 -0600 Subject: [PATCH] probable fix for race condition in check syntax (exposed by test suite) --- collects/drracket/private/syncheck/gui.rkt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index 4dfbc01fb3..8737c60333 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -1249,13 +1249,14 @@ If the namespace does not, they are colored the unbound color. (close-status-line 'drracket:check-syntax:status) ;; do this with some lag ... not great, but should be okay. - (thread - (λ () - (flush-output (send (send the-tab get-error-report-text) get-err-port)) - (queue-callback - (λ () - (unless (= 0 (send (send the-tab get-error-report-text) last-position)) - (show-error-report/tab)))))))] + (let ([err-port (send (send the-tab get-error-report-text) get-err-port)]) + (thread + (λ () + (flush-output err-port) + (queue-callback + (λ () + (unless (= 0 (send (send the-tab get-error-report-text) last-position)) + (show-error-report/tab))))))))] [kill-termination (λ () (unless normal-termination? @@ -1349,6 +1350,7 @@ If the namespace does not, they are colored the unbound color. (cleanup) (custodian-shutdown-all user-custodian))))] [else + (open-status-line 'drracket:check-syntax:status) (update-status-line 'drracket:check-syntax:status status-eval-compile-time) (eval-compile-time-part-of-top-level sexp) (parameterize ([current-eventspace drs-eventspace]) @@ -1363,6 +1365,7 @@ If the namespace does not, they are colored the unbound color. (expanded-expression user-namespace user-directory sexp jump-to-id)) (close-status-line 'drracket:check-syntax:status)))))) (update-status-line 'drracket:check-syntax:status status-expanding-expression) + (close-status-line 'drracket:check-syntax:status) (loop)]))))))))))])) ;; set-directory : text -> void