-
Notifications
You must be signed in to change notification settings - Fork 682
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
EventFd::defuse doesn't work #2422
Comments
Thanks for the report! Sorry for the late response! It indeed won't reset the kernel counter, and since it add 0 to the counter, this method looks like a no-op.
Yeah, I agree. Seems that we should simply remove this API? cc @JonathanWoollett-Light |
Just chiming in to confirm that I was also a bit confused by the behavior (and existence) of I guess that |
Would you like to elaborate on it a bit? Though I do agree if |
The first reason is symmetry - if The second thing I was thinking about is that if one creates an |
@SteveLauC I think removing it is reasonable, I don't remember any reason to argue against this. |
Get it, I will remove these 2 interfaces then, thanks. |
Documentation for eventfd: https://man7.org/linux/man-pages/man2/eventfd.2.html
Linux source code: https://github.com/torvalds/linux/blob/83814698cf48ce3aadc5
Both show that "write" adds the written value to the internal count. It will not reset the count or cause the next read call to block.
I think the only way to implement "defuse" would be as an alias for "read", which probably doesn't make sense and wouldn't even work for semaphore eventfds.
The text was updated successfully, but these errors were encountered: