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 2020/12/11 13:23:13 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2518: sched: Implement getpid and gettid correctly

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



##########
File path: sched/task/task_getpid.c
##########
@@ -95,11 +95,17 @@ pid_t getpid(void)
 
       if (rtcb->task_state == TSTATE_TASK_RUNNING)
         {
+#if !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SCHED_HAVE_PARENT)
+          /* Yes.. Return the task ID from the main TCB */

Review comment:
       Because the definition use the same condition(https://github.com/apache/incubator-nuttx/blob/master/include/nuttx/sched.h#L475):
   ```
   struct task_group_s
   {
   #if !defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SCHED_HAVE_PARENT)
     pid_t tg_task;                    /* The ID of the task within the group      */
   #endif
   ```




----------------------------------------------------------------
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:
users@infra.apache.org