You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/02 18:29:06 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #4048: libc: Move pthread_key_destructor to task_info_s

xiaoxiang781216 commented on a change in pull request #4048:
URL: https://github.com/apache/incubator-nuttx/pull/4048#discussion_r663180800



##########
File path: sched/group/group_create.c
##########
@@ -180,6 +180,10 @@ int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
       goto errout_with_stream;
     }
 
+  /* Initial user space semaphore */
+
+  _SEM_INIT(&group->tg_info->tg_sem, 0, 1);

Review comment:
       change to nxsem_init, _SEM_INIT is designed for the code need be compiled for both kernel and userspace

##########
File path: libs/libc/tls/Make.defs
##########
@@ -21,6 +21,7 @@
 CSRCS += task_getinfo.c
 
 ifneq ($(CONFIG_TLS_NELEM),0)
+CSRCS += tls_alloc.c tls_free.c tls_getdtor.c tls_getset.c tls_setdtor.c

Review comment:
       Remove tls_getdtor.c and tls_getset.c, it's more simple to call task_get_info directly.

##########
File path: include/nuttx/tls.h
##########
@@ -63,6 +63,15 @@
 
 struct task_info_s
 {
+  sem_t tg_sem;
+
+#if CONFIG_TLS_NELEM > 0
+  tls_ndxset_t tg_tlsset;                   /* Set of TLS indexes allocated */
+
+  tls_dtor_t  tg_tlsdestr[CONFIG_TLS_NELEM];  /* List of TLS destructors    */

Review comment:
       why has tg_tlsdestr and tg_tlsdtor? should we remove the similar field from task_group?




-- 
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: commits-unsubscribe@nuttx.apache.org

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