Skip to content

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Apr 9, 2025

This makes it so the only mutable access to the static mut is a single ptr::write initialization, and all shared references are ordered after that by the Once guard.

AFAIK we didn't have any actual bug here, but the lint highlighted the danger, and now we have more careful SAFETY comments.

@cuviper cuviper added this pull request to the merge queue Apr 9, 2025
Merged via the queue into rayon-rs:main with commit 9319496 Apr 9, 2025
4 checks passed
@cuviper cuviper deleted the static_mut_refs branch July 22, 2025 20:16
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.

1 participant