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

Shared: fix shared futures missing wake up #2899

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

Conversation

zekun000
Copy link

an attempt to fix #2706

the waker mutex is used to protect the state transition that involves wakers (add, wake, re-wake), if a waker is called during the polling, it sets the state to WOKEN_DURING_POLLING then the polling thread re-checks for potential new wakers and set state back to IDLE under the same mutex to avoid the race condition.

an unit test is adopted from the issue and added, without the fix, it'll be stuck within 5 loops on my laptop locally.

@zekun000
Copy link
Author

doesn't look like I can add reviewers or labels, manually tag here @taiki-e , would appreciate feedbacks or loop in proper reviewers, thanks

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.

Missed wake call using .shared()
1 participant