Skip to content

AtomicWeakRef #26

@BTOdell

Description

@BTOdell

Would it be possible to add a weak reference type to this library that doesn't include a lifetime parameter?
I've been trying to create something similar to "Box" but with thread-safe weak pointers;
or "Arc" but with the ability to into_inner and get the original value out.

Your library almost satisfies my requirements, but the lifetime requirement on the AtomicRef was problematic.

For reference:
https://www.reddit.com/r/rust/comments/1aq8zzf/help_implementing_an_atomic_reference_box_type/

Note that in my partial-implementation, the into_inner function can block until the weak references aren't actively borrowing. Not sure how this behavior would be accomplished in your library.

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