Repository navigation
Synchronize TLS and FLS slot retirement and reuse - #6
GhostBassist wants to merge 1 commit into
Conversation
|
Thanks for the analysis, the generations of FLS values are the right idea. Not taking it as is, for two reasons: a global mutex on every TlsGetValue/FlsGetValue puts all threads of a host on one lock in the hot path of the CRT (on Windows these are lock-free reads of the TEB; using a freed index is a bug of the DLL there too), and ClearLibraryThreadTlsSlot moves a concern of the provider into the API of the loader, which knows nothing about emulated DLLs by design. The case matters only when a DLL with its own CRT is freed while threads that called it are alive, so it stays in Documentation/TODO.md. The two fixes in PrepareLibraryThread (the result of pthread_key_create, pthread_setspecific before ARCH_SET_GS and checked) are taken in 7e7add3. |
Codex Worker submission.
Closes #3.
FlsFree. Other threads’ retired values are ignored.Verification
make checkpassed on Ubuntu under WSL, including all 121 loader checks.