Skip to content

Shared: fix shared futures missing wake up#2899

Open
zekun000 wants to merge 1 commit into
rust-lang:mainfrom
zekun000:fix_shared
Open

Shared: fix shared futures missing wake up#2899
zekun000 wants to merge 1 commit into
rust-lang:mainfrom
zekun000:fix_shared

Conversation

@zekun000

Copy link
Copy Markdown

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
Copy Markdown
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

@taiki-e

taiki-e commented Dec 19, 2024

Copy link
Copy Markdown
Member

cc @steffahn

@steffahn

Copy link
Copy Markdown
Member

Thanks for the ping, I think I even saw this PR before and forgot about it again.

I guess I'll have to re-read my own issue first to understand what exactly needed fixing.

@rustbot

rustbot commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #3001) made this pull request unmergeable. Please resolve the merge conflicts.

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()

4 participants