call-in-nested-thread: add prompt

Before 544b7a3d53, an incorrect barrier check prevented applying
a continuation captured in other threads from being applied in a
thread created with `call-in-nested-thread`. There's no good
reason to prohibit such an application, and now that the bogus
check is gone, an explicit prompt is needed in the implementation
to make it behave correctly.
This commit is contained in:
Matthew Flatt 2017-12-18 08:10:23 -07:00
parent f214bedf7d
commit 9e3bdaa328
2 changed files with 3 additions and 2 deletions

View File

@ -555,7 +555,8 @@
(sleep)
'not-void)))
(err/rt-test (let/cc k (call-in-nested-thread (lambda () (k)))) exn:fail:contract:continuation?)
(test 1 call-with-continuation-prompt (lambda ()
(let/cc k (call-in-nested-thread (lambda () (k 1))))))
(err/rt-test (let/ec k (call-in-nested-thread (lambda () (k)))) exn:fail:contract:continuation?)
(err/rt-test ((call-in-nested-thread (lambda () (let/cc k k)))) exn:fail:contract:continuation?)
(err/rt-test ((call-in-nested-thread (lambda () (let/ec k k)))) exn:fail:contract:continuation?)

View File

@ -3731,7 +3731,7 @@ Scheme_Object *scheme_call_as_nested_thread(int argc, Scheme_Object *argv[], voi
v = NULL;
failure = 1;
} else {
v = scheme_apply(argv[0], 0, NULL);
v = scheme_apply_with_prompt(argv[0], 0, NULL);
failure = 0;
}