It should be noted that TLS is a pretty awkward hybrid between static and automatic variables and at the end of the day a crutch.
The reason why it exists in the first place is its poster case errno - in the days before multithreading a global variable, but when multithreading came into play, all non-reentrant usages of errno in existing code (eg libraries) ran into concurreny troubles. Note that relocating errno into TLS opens up another Pandora Box of troubles, eg whether and if how to resync the thread specific instances at join time. At the end of the day, TLS appears to be a workaround for C failing to be able to support dynamic vs. lexical scoping.
For new developments not involving legacy code, I can not think of a single use case for TLS. If you need reentrant code, use local variables. If you need to access shared data, use static/global storage and mutual exclusion.
I’d be intersted in seeing a real use case for TLS for new developments. I came across a sketch here: Thread local storage for “advanced users”? - Kernel - FreeRTOS Community Forums , but I believe there are better ways to solve that issue - TLS will somewhat work but at a cost. In that use case, I’d prefer to pass a reference to the watchdog counter value instance down to the share code; if for no other reason, then for referential transparency which becomes completly outlevered with TLS.