diff --git a/design/mvp/CanonicalABI.md b/design/mvp/CanonicalABI.md index 3c122946..e2007246 100644 --- a/design/mvp/CanonicalABI.md +++ b/design/mvp/CanonicalABI.md @@ -712,18 +712,18 @@ called). ``` When a `Subtask` finishes, it calls `release_lenders` to allow owned handles -passed to this subtask to be dropped. In the synchronous or eager case this -happens immediately before returning to the caller. In the -asynchronous+blocking case, this happens right before the `CallState.DONE` -event is delivered to the guest program. +passed to this subtask to be dropped. In the asynchronous blocking case, this +happens right before the `CallState.DONE` event is delivered to the guest +program in `subtask_event()` (above). Otherwise, it happens synchronously +when the subtask finishes. ```python def finish(self): assert(self.state == CallState.RETURNED) self.state = CallState.DONE - if self.opts.sync or not self.notify_supertask: - self.release_lenders() - else: + if self.notify_supertask: self.maybe_notify_supertask() + else: + self.release_lenders() return self.flat_results ``` diff --git a/design/mvp/canonical-abi/definitions.py b/design/mvp/canonical-abi/definitions.py index 55fe2d38..d5aa45b1 100644 --- a/design/mvp/canonical-abi/definitions.py +++ b/design/mvp/canonical-abi/definitions.py @@ -520,10 +520,10 @@ def on_return(self, vs): def finish(self): assert(self.state == CallState.RETURNED) self.state = CallState.DONE - if self.opts.sync or not self.notify_supertask: - self.release_lenders() - else: + if self.notify_supertask: self.maybe_notify_supertask() + else: + self.release_lenders() return self.flat_results def drop(self):