This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 5fb2ff3fe9b sched/tls: fix thread ID initialization in tls_dup_info
5fb2ff3fe9b is described below
commit 5fb2ff3fe9b734d5660ed356a0c475312ee02b11
Author: hujun5 <[email protected]>
AuthorDate: Thu Jun 5 17:21:06 2025 +0800
sched/tls: fix thread ID initialization in tls_dup_info
Set the thread ID (tl_tid) to the destination task's pid during TLS
duplication in fork operations. This ensures the duplicated TLS info
correctly reflects the forked task's thread identifier.
Signed-off-by: hujun5 <[email protected]>
---
sched/tls/tls_dupinfo.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sched/tls/tls_dupinfo.c b/sched/tls/tls_dupinfo.c
index 0987e9d6170..5ee29d93de9 100644
--- a/sched/tls/tls_dupinfo.c
+++ b/sched/tls/tls_dupinfo.c
@@ -77,5 +77,9 @@ int tls_dup_info(FAR struct tcb_s *dst, FAR struct tcb_s *src)
info->tl_argv = NULL;
+ /* Thread ID */
+
+ info->tl_tid = dst->pid;
+
return OK;
}