Open madsmtm opened 3 months ago
Clang has bindings for Swift's @Sendable protocol on blocks (with the default being non-sendable), we should add support for this into block2.
@Sendable
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.
Block<dyn Fn() + Send + Sync>
Deref
Notes in this comment on whether we should have both Send + Sync, or if we can get away with one of those bounds.
Send + Sync
Clang has bindings for Swift's
@Sendable
protocol on blocks (with the default being non-sendable), we should add support for this intoblock2
.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 throughDeref
.Notes in this comment on whether we should have both
Send + Sync
, or if we can get away with one of those bounds.