Skip to content

Send + Sync / @Sendable blocks #572

Open
@madsmtm

Description

@madsmtm

Clang has bindings for Swift's @Sendable protocol on blocks (with the default being non-sendable), we should add support for this into block2.

Basic idea is to allow Block<dyn Fn() + Send + Sync>, though since we don't have custom coercions yet, it likely won't be as pretty as through Deref.

Notes in this comment on whether we should have both Send + Sync, or if we can get away with one of those bounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-block2Affects the `block2` crateenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions