Skip to content

core::pipes::try_recv_ missing an acquire barrier #7021

Closed
@talchas

Description

@talchas
fn try_recv_<T:Owned>(p: &mut Packet<T>) -> Option<T> {
    // optimistic path
    match p.header.state {
      Full => {
        let payload = replace(&mut p.payload, None);

The read of p.header.state needs to be an acquire barrier probably via atomic_load_acq to ensure it comes before the read of p.payload, matching with the release by swap_state_rel in send.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions