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



##########
File path: sched/group/group_create.c
##########
@@ -138,6 +139,9 @@ int group_allocate(FAR struct task_tcb_s *tcb, uint8_t 
ttype)
       return -ENOMEM;
     }
 
+  group->tg_info = (FAR struct task_info_s *)
+    group_zalloc(group, sizeof(struct task_info_s));

Review comment:
       > group_malloc looks at the GROUP_FLAG_PRIVILEGED bit, which has not 
been set yet here. is it intended?
   > 
   
   Yes, the code need move to:
   
https://github.com/apache/incubator-nuttx/pull/3992/files#diff-2b2403bb769be0921afc3e368b8f5e44acd58e6d8e97f2bc1e66064e3ca2de28L169
   
   > is task_info_s planned to be used for GROUP_FLAG_PRIVILEGED at all?
   
   The current kernel thread implementation is actually a normal task with 
privileged permission. task_info_s is a critical data structure associate with 
many key functions, so it required here.
   
   > 
   > i'm still not sure how this can work for CONFIG_BUILD_KERNEL. (i'm just 
asking here because i dunno.)
   
   The whole path is a follow up of: 
https://github.com/apache/incubator-nuttx/pull/997 and no body report that #997 
break the kernel build. Since #997 enter the mainline more than two years, I 
think the approach should work in KERNEL mode.




-- 
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-unsubscr...@nuttx.apache.org

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


Reply via email to