nuttx/sched
ligd 1552e52e14 signal: fix group signal can't dispatch some parent group twice
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>
2023-08-03 03:35:59 -07:00
..
addrenv sched/addrenv.c: Implement re-entrancy for addrenv_select() 2023-04-25 14:33:19 +02:00
clock cmake/sched: fix build break based on mainline 2023-07-10 13:26:21 +08:00
environ build: add initial cmake build system 2023-07-08 13:50:48 +08:00
group signal: fix group signal can't dispatch some parent group twice 2023-08-03 03:35:59 -07:00
init build: add initial cmake build system 2023-07-08 13:50:48 +08:00
irq arch: update g_running_tasks when context switch occurred 2023-08-01 09:35:18 -07:00
misc assert: Remove unnecessary disable interrupts code 2023-08-03 03:17:22 -07:00
module libc/symtab: Don't include symtab.h in the header files 2023-07-10 23:03:17 +03:00
mqueue sched/mqueue/mq_sndinternal.c: Update the return value in description "Message queue opened not opened for writing". 2023-08-03 03:10:56 -07:00
paging build: add initial cmake build system 2023-07-08 13:50:48 +08:00
pthread sched/pthread: Don't do cancel when it is already in the exit process 2023-08-03 03:12:36 -07:00
sched SMP: fix repeat entry oneshot_tick_start 2023-08-03 03:20:40 -07:00
semaphore build: add initial cmake build system 2023-07-08 13:50:48 +08:00
signal sched/pthread: Don't do cancel when it is already in the exit process 2023-08-03 03:12:36 -07:00
task task_spawnparms: out of loop when ret less than 0 2023-07-31 00:47:42 -07:00
timer build: add initial cmake build system 2023-07-08 13:50:48 +08:00
tls libs/pthread/pthread_atfork: fulfill implement pthread_atfork function 2023-07-26 10:41:52 +02:00
wdog build: add initial cmake build system 2023-07-08 13:50:48 +08:00
wqueue drivers: Format pointer through "%p" for kthread_create 2023-07-30 23:40:59 +03:00
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
Kconfig pthread: Extend the up limit of PTHREAD_CLEANUP_STACKSIZE to 255 2023-07-20 08:11:30 +02:00
Makefile group/group_addrenv: Move address environment from group -> tcb 2023-02-08 02:51:23 +08:00