Skip to content

Is deadlock unsafe? #2821

Closed
Closed
@bblum

Description

@bblum

arc::exclusive is marked unsafe because it can deadlock trivially. But it's not too hard to use comm::port to deadlock too, and marking our core communication mechanism as unsafe is probably unwise.

Before removing the unsafe tag from exclusive.with(), though, perhaps we should think up a way to use borrowck to enforce that you don't call with within a with on the same exclusive (or maybe make them support recursive locking!!). Of course we can't statically prevent multi-exclusive deadlock, but the trivial ones might be doable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions