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

Tracking Issue for atomic_try_update #135894

Open
3 of 5 tasks
GrigorenkoPV opened this issue Jan 22, 2025 · 0 comments
Open
3 of 5 tasks

Tracking Issue for atomic_try_update #135894

GrigorenkoPV opened this issue Jan 22, 2025 · 0 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@GrigorenkoPV
Copy link
Contributor

GrigorenkoPV commented Jan 22, 2025

Feature gate: #![feature(atomic_try_update)]

This is a tracking issue for an infallible version of AtomicT::fetch_update as well as a new name for the existing fallible version.

When and if this gets stabilized, the existing fetch_update should be marked as a deprecated alias for try_update.

Public API

impl AtomicT {
    // same as `fetch_update`
    pub fn try_update(
        &self,
        set_order: Ordering,
        fetch_order: Ordering,
        f: impl FnMut(T) -> Option<T>,
    ) -> Result<T, T>;

    pub fn update(
        &self,
        set_order: Ordering,
        fetch_order: Ordering,
        f: impl FnMut(T) -> T,
    ) -> T;
}

Steps / History

Unresolved Questions

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@GrigorenkoPV GrigorenkoPV added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant