Skip to content

Commit 061fd06

Browse files
committed
Async CABI: remove superfluous condition
1 parent 2323ed5 commit 061fd06

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

design/mvp/CanonicalABI.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -712,18 +712,18 @@ called).
712712
```
713713

714714
When a `Subtask` finishes, it calls `release_lenders` to allow owned handles
715-
passed to this subtask to be dropped. In the synchronous or eager case this
716-
happens immediately before returning to the caller. In the
717-
asynchronous+blocking case, this happens right before the `CallState.DONE`
718-
event is delivered to the guest program.
715+
passed to this subtask to be dropped. In the asynchronous blocking case, this
716+
happens right before the `CallState.DONE` event is delivered to the guest
717+
program in `subtask_event()` (above). Otherwise, it happens synchronously
718+
when the subtask finishes.
719719
```python
720720
def finish(self):
721721
assert(self.state == CallState.RETURNED)
722722
self.state = CallState.DONE
723-
if self.opts.sync or not self.notify_supertask:
724-
self.release_lenders()
725-
else:
723+
if self.notify_supertask:
726724
self.maybe_notify_supertask()
725+
else:
726+
self.release_lenders()
727727
return self.flat_results
728728
```
729729

design/mvp/canonical-abi/definitions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,10 @@ def on_return(self, vs):
520520
def finish(self):
521521
assert(self.state == CallState.RETURNED)
522522
self.state = CallState.DONE
523-
if self.opts.sync or not self.notify_supertask:
524-
self.release_lenders()
525-
else:
523+
if self.notify_supertask:
526524
self.maybe_notify_supertask()
525+
else:
526+
self.release_lenders()
527527
return self.flat_results
528528

529529
def drop(self):

0 commit comments

Comments
 (0)