-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Description
The cancellation mechanism of session exceptions causes the runtime/evaluator to hang indefinitely in some cases when the context to be cancelled closes over a captured continuation. The following example triggers this behaviour.
# options: `effect_handlers=true` and `session_exceptions=true`.
sig throw : () {Throw : forall a. () => a |e}~> a
fun throw() { do Throw }
sig example : () { Throw{_}, SessionFail{_} |e}~> ()
fun example() {
handle({
var c = fork(fun(c) {
var (_, c) = receive(c);
close(c)
});
throw();
var c = send(42, c);
close(c)
}) {
case <Throw => resume> : (forall a. () => a) ->
try { raise; resume(unsafe_cast(())) }
as () in { () }
otherwise { () }
}
}