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/04 06:48:27 UTC

[GitHub] [incubator-nuttx] sgysh opened a new pull request #2475: sched/sched/sched_waitid.c: Fix two bugs when CONFIG_SCHED_CHILD_STATUS is enabled

sgysh opened a new pull request #2475:
URL: https://github.com/apache/incubator-nuttx/pull/2475


   ## Summary
   
    - Fix an error that occurs when a waiting task has already finished.
    - Discard the child entry after receiving SIGCHLD.
   
   ## Impact
   
    - waitid
   
   ## Testing
   
   hifive1-revb:nsh (CONFIG_SCHED_HAVE_PARENT=y, CONFIG_SCHED_CHILD_STATUS=y, CONFIG_SIG_DEFAULT=y)
   on QEMU
   
   ```
   static int task_main(int argc, char *argv[])
   {
     return 0;
   }
   
   int main(int argc, FAR char *argv[])
   {
     siginfo_t info;
     int pid;
     int ret;
   
     pid = task_create("task", 224, 1024, task_main, NULL);
   
     sleep(1);
   
     ret = waitid(P_PID, pid, &info, WEXITED);
   
     assert(ret == 0);
   
     return 0;
   }
   ```
   
   ```
   static int task_main(int argc, char *argv[])
   {
     sleep(1);
     return 0;
   }
   
   int main(int argc, FAR char *argv[])
   {
     pid_t pid;
     siginfo_t info;
     int ret;
   
     pid = task_create("task1", 224, 1024, task_main, NULL);
     task_create("task2", 224, 1024, task_main, NULL);
   
     waitid(P_PID, pid, &info, WEXITED);
     waitid(P_ALL, 0, &info, WEXITED);
     ret = waitid(P_ALL, 0, &info, WEXITED | WNOHANG);
   
     assert(ret == -1);
   
     return 0;
   }
   ```


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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #2475: sched/sched/sched_waitid.c: Fix two bugs when CONFIG_SCHED_CHILD_STATUS is enabled

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #2475:
URL: https://github.com/apache/incubator-nuttx/pull/2475


   


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