Skip to content

Conversation

@cramertj
Copy link
Member

@cramertj cramertj commented Jan 5, 2026

After unwrapping the Arc, the reader should observe all writes that occurred before the penultimate refcount was dropped. Note that this is consistent with the ordering used in Arc::is_unique and Arc::make_mut, both of which have similar function.

See also discussion on #150631 (comment)
r? @Mark-Simulacrum

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 5, 2026
@rust-log-analyzer

This comment has been minimized.

After unwrapping the Arc, the reader should observe all writes that
occurred before the penultimate refcount was dropped. Note that
this is consistent with the ordering used in `Arc::is_unique`
and `Arc::make_mut`, both of which have similar function.
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 5, 2026

📌 Commit f975271 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 5, 2026
// of the penultimate `Arc`, allowing the resulting value to contain
// all modifications that may have happened due to that copy of the
// `Arc`.
if this.inner().strong.compare_exchange(1, 0, Acquire, Relaxed).is_err() {
Copy link
Contributor

@tmiasko tmiasko Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you perhaps missed the fact that the success path already contains acquire fence?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, yes! Thank you.

@cramertj cramertj closed this Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants