From e8902f9981d4d71a97e25c6fed475623dab0d362 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 30 Jan 2012 07:52:52 -0600 Subject: [PATCH] added a hack to keep DrRacket from freezing when it is unable to detect if a (n online check syntax) rename would conflict with an existing name. (This can happen because the remote place's custodian gets shutdown due to, for example, another tab's online check syntax running.) --- collects/drracket/private/syncheck/gui.rkt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index 9e239c6e83..201b38f232 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -1630,7 +1630,21 @@ If the namespace does not, they are colored the unbound color. [`(syncheck:add-docs-menu ,text ,start-pos ,end-pos ,key ,the-label ,path ,tag) (send defs-text syncheck:add-docs-menu defs-text start-pos end-pos key the-label path tag)] [`(syncheck:add-rename-menu ,id-as-sym ,to-be-renamed/poss ,name-dup-pc ,name-dup-id) - (define (name-dup? name) (place-channel-put/get name-dup-pc (list name-dup-id name))) + (define other-side-dead? #f) + (define (name-dup? name) + (cond + [other-side-dead? + ;; just give up here ... + #f] + [else + (place-channel-put name-dup-pc (list name-dup-id name)) + (define res (sync/timeout .5 (handle-evt name-dup-pc list))) + (cond + [(list? res) (car res)] + [else + (printf "other side died\n") + (set! other-side-dead? #t) + #f])])) (define to-be-renamed/poss/fixed (for/list ([lst (in-list to-be-renamed/poss)]) (list defs-text (list-ref lst 1) (list-ref lst 2))))