Skip to content

source/futures: Fix handling of notified atomic #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Jun 17, 2025

Previously, notified was cleared before the
self.source.process_events call. This meant that it was cleared before reading from the ping source eventfd/pipe.

This means that a call to send() form a waker in a different thread could call ping() before this has been read, and prevent future calls to ping(). But process_events() won't be woken again, freezing the executor.

This seems to fix an issue I've seen in cosmic-workspaces when trying to use the calloop executor.

Previously, `notified` was cleared before the
`self.source.process_events` call. This meant that it was cleared before
reading from the ping source eventfd/pipe.

This means that a call to `send()` form a waker in a different thread
could call `ping()` before this has been read, and prevent future calls
to `ping()`. But `process_events()` won't be woken again, freezing the
executor.

This seems to fix an issue I've seen in `cosmic-workspaces` when trying
to use the `calloop` executor.
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.

1 participant