mirror of
https://github.com/apple/swift-nio
synced 2026-11-22 04:30:41 +00:00
### Motivation: The bootstraps are the next most obvious target for cleaning up Sendability issues. These issues are mostly just missing annotations, but there are a few places where we had actual latent threading bugs that were missed. A lot more of the control flow is made more explicit in this patch, and in general it should get a lot easier to be confident that the code is correct. ### Modifications: - Add necessary `@Sendable` annotations - Clean up some incorrect `self` captures of bootstraps, which are not `Sendable`, and which could lead to real threading bugs - Make a few methods `static` to avoid needing to capture `self` at all. - Make a few threading assumptions clear by using the isolated views or the sync operations - Add some missing `Sendable` constraints on interior generic functions. ### Result: Better safety, better correctness in the bootstraps.