Skip to content

[WIP] Allow cancellation between reschedule() called and task resumed - #3496

Open
arthur-tacca wants to merge 1 commit into
python-trio:mainfrom
arthur-tacca:allow-cancellation-after-reschedule
Open

[WIP] Allow cancellation between reschedule() called and task resumed#3496
arthur-tacca wants to merge 1 commit into
python-trio:mainfrom
arthur-tacca:allow-cancellation-after-reschedule

Conversation

@arthur-tacca

Copy link
Copy Markdown
Contributor

Fixes #2973

  • reschedule() gets a new parameter allow_abort: bool which, if True, still allows the abort function to be called right up until the task actually resumed. It is False by default so it's backwards compatible.
  • When Event.wait() is woken by Event.set() it uses this parameter, so cancellation of it always succeeds

Not ready to merge I think the code is fine but:

  • No tests
  • No docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cancellation may not always immediately happen at checkpoints

1 participant