Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send + Sync / @Sendable blocks #572

Open
madsmtm opened this issue Feb 2, 2024 · 0 comments
Open

Send + Sync / @Sendable blocks #572

madsmtm opened this issue Feb 2, 2024 · 0 comments
Labels
A-block2 Affects the `block2` crate enhancement New feature or request

Comments

@madsmtm
Copy link
Owner

madsmtm commented Feb 2, 2024

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.

@madsmtm madsmtm added enhancement New feature or request A-block2 Affects the `block2` crate labels Feb 2, 2024
@madsmtm madsmtm mentioned this issue Feb 2, 2024
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-block2 Affects the `block2` crate enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant