From 970baf7a36cffffbe89654fecd197061e5263427 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 21 Jul 2016 15:14:03 -0400 Subject: [PATCH] Forbid multiple uses of a suspend-script continuation --- racket/syndicate/actor.rkt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/racket/syndicate/actor.rkt b/racket/syndicate/actor.rkt index 919272a..d9e6bc6 100644 --- a/racket/syndicate/actor.rkt +++ b/racket/syndicate/actor.rkt @@ -991,6 +991,7 @@ (lambda () (define suspended-fid (current-facet-id)) (define in? (in-script?)) + (define stale? #f) (define raw-resume-parent (capture-facet-context (lambda results @@ -998,6 +999,10 @@ (apply k results))))) (define resume-parent (lambda results + (when stale? (error 'suspend-script + "Attempt to resume suspension (suspended at ~a) more than once" + where)) + (set! stale? #t) (abort-current-continuation prompt-tag (lambda ()