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

InitOnce: synchronize with completion when already complete #2641

Merged
merged 3 commits into from
Nov 4, 2022

Conversation

beepster4096
Copy link
Contributor

The completion of an InitOnce happens-before the threads waiting on it wake up. However, this is not the case for threads that call InitOnceBeginInitialize after the completion, leading to data races and outdated weak memory loads as observed in the CI for #2638. This PR fixes this.

src/shims/windows/sync.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

RalfJung commented Nov 4, 2022

Thanks, looks good!
@bors r+

@bors
Copy link
Contributor

bors commented Nov 4, 2022

📌 Commit bc05e6b has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 4, 2022

⌛ Testing commit bc05e6b with merge 9568d7e...

@bors
Copy link
Contributor

bors commented Nov 4, 2022

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 9568d7e to master...

@bors bors merged commit 9568d7e into rust-lang:master Nov 4, 2022
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Nov 15, 2022
spikespaz pushed a commit to spikespaz/dotwalk-rs that referenced this pull request Aug 29, 2024
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.

3 participants