Tracking Issue for atomic_try_update · Issue #135894 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@GrigorenkoPV

Description

@GrigorenkoPV

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, ) -> Result<T, T>;

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

}

Steps / History

Unresolved Questions

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