mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
### Motivation: NIOThread assumed it can hold onto `pthread_t` forever. Unfortunately, on Linux, `pthread_t` is dead when the thread got joined (if not detached) or if it exits (if detached) _which is at a random point in time_. ### Modifications: - Only assume ownership owner the `pthread_t` if not detached - `nil` out the `pthread_t` on `join()` ### Result: - Fewer `pthread_t` lifecycle bugs.