Skip to content
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

Clear AsyncFd readiness in read_event #7

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

Conversation

RoastVeg
Copy link

@RoastVeg RoastVeg commented Dec 3, 2024

@seimonw correctly identified in #6 that tokio-gpiod fails in repeated calls to read_event with EWOULDBLOCK/EAGAIN, but mistakenly assumes it's due to NONBLOCK having been set. This is actually due to the fact that the readiness flag in AsyncFd is not cleared after the first call to readable.

The easiest way to solve the problem is by following the example given in the AsyncFd docs

@nsabovic
Copy link

nsabovic commented Mar 3, 2025

Just a ping to see if we can have this merged?

I've verified that it works in my code, but it can also be tested with the CLI—without this commit tgpio mon fails after the first state change. With this change the CLI works and doesn't have spurious wakeups.

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.

2 participants