1552e52e14
reproduce: static void *pthread(void *arg) { system(arg); } void test (int argc, char *argv[]) { pthread_create(&pthread0, &attr, pthread, argv[1]); pthread_create(&pthread1, &attr, pthread, argv[2]); } only one pthread system() returnd, othres hanged rootcause: As we known, system() will create a new task called: system -c XX The example: parent group child groups pthread0 -> waitpid() -> system -c ps -> exit() -> nxtask_signalparent() pthread1 -> waitpid() -> system -c ls -> exit() -> nxtask_signalparent() Each child group exit with function nxtask_signalparent(), As we expect: system -c ps will signal pthread0 system -c ls will signal pthread1 But actually: system -c ps will signal pthread0/1 system -c ls will signal pthread0/1 As the spec, we know, this behavior is normal: https://man7.org/linux/man-pages/man2/sigwaitinfo.2.html So for this situation, when the signo is SIGCHLD, we broadcast. Signed-off-by: ligd <liguiding1@xiaomi.com> |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
group_argvstr.c | ||
group_childstatus.c | ||
group_continue.c | ||
group_create.c | ||
group_exitinfo.c | ||
group_find.c | ||
group_foreachchild.c | ||
group_free.c | ||
group_getgid.c | ||
group_getuid.c | ||
group_join.c | ||
group_killchildren.c | ||
group_leave.c | ||
group_malloc.c | ||
group_realloc.c | ||
group_setgid.c | ||
group_setuid.c | ||
group_setupidlefiles.c | ||
group_setupstreams.c | ||
group_setuptaskfiles.c | ||
group_signal.c | ||
group_suspendchildren.c | ||
group_waiter.c | ||
group_zalloc.c | ||
group.h | ||
Make.defs |