This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 8efff3ccf6e6844359ff7231339fbf32efb9c313 Author: Marco Casaroli <[email protected]> AuthorDate: Mon Oct 19 11:53:11 2026 +0200 Documentation: The __thread copies of a module go when it is unloaded. The TLS guide says that a copy is freed when its thread exits. It now also says that the copies are freed in every thread when the module or shared library that defines the variable is unloaded. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- Documentation/guides/concurrency/thread_local_storage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/guides/concurrency/thread_local_storage.rst b/Documentation/guides/concurrency/thread_local_storage.rst index b3e98313d7c..5dd94fa1176 100644 --- a/Documentation/guides/concurrency/thread_local_storage.rst +++ b/Documentation/guides/concurrency/thread_local_storage.rst @@ -44,6 +44,6 @@ Then you can see ``--disable-tls`` in the output, which means that your compiler In this case, you can still use the thread local relative keyword, but it would be implemented by libgcc's emutls. -NuttX's libc provides its own version (``CONFIG_TLS_EMUTLS``, set for the GCC and clang toolchains when libgcc is the builtin library, ``CONFIG_BUILTIN_TOOLCHAIN``; the sim has it with GCC and the GNU linker, as on Linux and MinGW), and the link sends the calls to ``__emutls_get_address()`` there with ``--wrap``. A libgcc built with the single thread model (``Thread model: single`` above) keeps one copy of each variable for the whole program; with the libc version, each thread gets its o [...] +NuttX's libc provides its own version (``CONFIG_TLS_EMUTLS``, set for the GCC and clang toolchains when libgcc is the builtin library, ``CONFIG_BUILTIN_TOOLCHAIN``; the sim has it with GCC and the GNU linker, as on Linux and MinGW), and the link sends the calls to ``__emutls_get_address()`` there with ``--wrap``. A libgcc built with the single thread model (``Thread model: single`` above) keeps one copy of each variable for the whole program; with the libc version, each thread gets its o [...] The image, the modules and the programs of a kernel build are linked with ``--wrap``; code loaded at run time finds the libc version in the system symbol table (``CONFIG_EXECFUNCS_SYSTEM_SYMTAB``).
