Skip to content

AtomicU8 is stable (and supported by the MSRV) #744

Open
@steffahn

Description

@steffahn

Apparently, crossbeam has MSRV 1.36, which includes AtomicU8. Hence the following comment is outdated:

// We need a volatile read here because other threads might concurrently modify the
// value. In theory, data races are *always* UB, even if we use volatile reads and
// discard the data when a data race is detected. The proper solution would be to
// do atomic reads and atomic writes, but we can't atomically read and write all
// kinds of data since `AtomicU8` is not available on stable Rust yet.
let val = ptr::read_volatile(src);

Considering that this comment legitimizes code that is officially UB, I propose that this should be fixed, if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions