Skip to content

Commit

Permalink
Async CABI: remove superfluous condition
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner committed Oct 11, 2024
1 parent 2323ed5 commit 061fd06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions design/mvp/CanonicalABI.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
6 changes: 3 additions & 3 deletions design/mvp/canonical-abi/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 061fd06

Please sign in to comment.