patacongo commented on a change in pull request #3517:
URL: https://github.com/apache/incubator-nuttx/pull/3517#discussion_r611829810



##########
File path: sched/pthread/pthread_create.c
##########
@@ -301,11 +303,16 @@ int pthread_create(FAR pthread_t *thread, FAR const 
pthread_attr_t *attr,
       goto errout_with_join;
     }
 
-#ifndef CONFIG_BUILD_KERNEL
-  /* Save the allocated task data in TLS */
+  /* Initialize thread local storage */
 
-  tls_set_taskdata(&ptcb->cmn);
-#endif
+  info = up_stack_frame(&ptcb->cmn, sizeof(struct tls_info_s));
+  if (info == NULL)
+    {
+      errcode = ENOMEM;
+      goto errout_with_join;
+    }
+

Review comment:
       I still don't understand this.  The high performance access to aligned 
stacks requires that the TLS data lie at the stack allocation access.  For a 
push down stack, up_stack_frame() allocates memory downward from the highest 
stack addresses.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to