TLS cleanups
Minor TLS cleanups, mostly small refactors for clarity, and updates to documentation, with a few lib/_tls_wrap debug statements thrown in.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
documentation is changed or added -
commit message follows commit guidelines