Skip to content

Shared<T>::deref() should be marked as unsafe #137

@jeehoonkang

Description

@jeehoonkang

Related discussion: https://github.com/stjepang/coco/pull/2

The dereference of a Shared<T>, may race with the writer of the shared data of type T. For example, suppose a Box<T> is written to Atomic<T> with store_ref(Relaxed), and later another thread read the Atomic<T> with load(Relaxed). Then the Box<T> itself may not have been synchronized, and the dereference of the loaded Shared<T> may invoke undefined behavior.

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