SPRUI04F july 2015 – april 2023
The compiler supports the __thread qualifier to identify a data object that is to be given thread-private storage. To access a variable that has been identified as thread-local, the compiler will rely on support of the runtime operating system's thread library to find the run-time location of a thread-local variable. Specifically, the thread library must provide an implementation of the __c6xabi_get_tp() function. The runtime operating system's thread library will provide the address of a TLS block that has been allocated on behalf of the currently executed thread and then the compiler can access data in the TLS block with knowledge of where a given thread-local variable exists within the TLS block.
Further information about TLS data objects can be found in the C6000 Embedded Application Binary Interface Application Report (SPRAB89A).