The IAR C run-time library offers thread local storage and reentrancy support. In order to use those capabilities with ThreadX this symbol needs to be defined during compilation. For more information about the IAR C run-time library please refer to their documentation.
This capability is port specific and hence documented on the port readme file (for Cortex M7, that file is here https://github.com/azure-rtos/threadx/blob/master/ports/cortex_m7/iar/readme_threadx.txt)
Here is the relevant chapter from that readme file:
- IAR Thread-safe Library Support
Thread-safe support for the IAR tools is easily enabled by building the ThreadX library
and the application with TX_ENABLE_IAR_LIBRARY_SUPPORT. Also, the linker control file
should have the following line added (if not already in place):
initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
The project options "General Options -> Library Configuration" should also have the
"Enable thread support in library" box selected.