mirror of
https://github.com/apple/swift-nio
synced 2026-11-26 04:57:49 +00:00
Motivation: Previously we leaked `pthread_key`s as we only ever called `pthread_key_create` but never `pthread_key_delete`. This patch fixes that. Modifications: - made `ThreadSpecificVariable` a class (so we get lifecycle management through ARC) - instead of just storing the value, store `Box<(ThreadSpecificVariable<T>, T)>` so we can control the lifecycle of the `ThreadSpecificVariable` as needed Result: We don't leak `pthread_key`s anymore.