acassis commented on code in PR #3412:
URL: https://github.com/apache/nuttx-apps/pull/3412#discussion_r2849456235
##########
testing/ostest/sched_thread_local.c:
##########
@@ -114,6 +114,23 @@ static void *thread_func(void *parameter)
ASSERT(false);
}
+ printf("thread_func[%d]: TLS addr=%p\n", id, &g_tls_int);
+
+ /* In a broken system, all threads might point to the same static address */
+
+ static void *g_first_thread_addr = NULL;
+ if (id == 0)
Review Comment:
Did you try to print the "id" ? I think it never will be 0, if I'm not wrong
(and I could be wrong) it starts from 1.
##########
testing/ostest/sched_thread_local.c:
##########
@@ -114,6 +114,23 @@ static void *thread_func(void *parameter)
ASSERT(false);
}
+ printf("thread_func[%d]: TLS addr=%p\n", id, &g_tls_int);
+
+ /* In a broken system, all threads might point to the same static address */
+
+ static void *g_first_thread_addr = NULL;
Review Comment:
@Biancaa-R all common code (that needs to work on old microcontrollers)
should follow the C89. Please read the
https://nuttx.apache.org/docs/latest/contributing/coding_style.html for more
info about the NuttX coding style
##########
testing/ostest/sched_thread_local.c:
##########
@@ -114,6 +114,23 @@ static void *thread_func(void *parameter)
ASSERT(false);
}
+ printf("thread_func[%d]: TLS addr=%p\n", id, &g_tls_int);
+
+ /* In a broken system, all threads might point to the same static address */
+
+ static void *g_first_thread_addr = NULL;
Review Comment:
Other detail: g_ is used when you are defining a global variable, that is
not the case here since you are defining it inside a function
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]