diff --git a/collects/tests/mzscheme/prompt-tests.ss b/collects/tests/mzscheme/prompt-tests.ss index f0ed7076b6..243282a59c 100644 --- a/collects/tests/mzscheme/prompt-tests.ss +++ b/collects/tests/mzscheme/prompt-tests.ss @@ -1667,6 +1667,27 @@ (test '(1 2 3 4 5 1 2 3 4 5 1 6 6 2 3 4 5 1 6 6) go (default-continuation-prompt-tag) #f) (test '(1 2 3 4 5 1 2 3 4 5 1 6 6 2 3 4 5 1 6 6) go (make-continuation-prompt-tag) #f)) +;; ---------------------------------------- +;; Run two levels of continuations where an explicit +;; prompt in a capturing thread is represented by an +;; implicit prompt in the calling thread. + +(let () + (define (foo thunk) + (call-with-continuation-prompt + (lambda () + (let/cc ret + (let ([run? #f]) + (let/cc run + (thread (lambda () + (sync (system-idle-evt)) + (set! run? #t) + (run)))) + (when run? (ret (thunk)))))))) + (define s (make-semaphore)) + (foo (lambda () (semaphore-post s))) + (test s sync s)) + ;; ---------------------------------------- ;; Try long chain of composable continuations diff --git a/src/mzscheme/src/eval.c b/src/mzscheme/src/eval.c index 71df9b4243..351622f00d 100644 --- a/src/mzscheme/src/eval.c +++ b/src/mzscheme/src/eval.c @@ -5961,7 +5961,7 @@ Scheme_Object *scheme_jump_to_continuation(Scheme_Object *obj, int num_rands, Sc created with a new thread or a barrier prompt. */ p->meta_continuation = NULL; /* since prompt wasn't in any meta-continuation */ p->meta_prompt = NULL; - if (c->barrier_prompt == barrier_prompt) { + if ((c->barrier_prompt == barrier_prompt) && barrier_prompt) { /* Barrier determines continuation end. */ c->resume_to = NULL; p->stack_start = c->stack_start;