I have 2 processes written in C, I'll call them 'parent' and 'child'.
Parent creates child and child enters a loop where it does some code, then raises SIGSTOP. If a certain condition is reached, the parent needs to send the child SIGTERM, otherwise SIGCONT.
How can I send it SIGTERM while it is suspended and get exactly my desired results? By simply sending it SIGCONT then SIGTERM I'm afraid the child will reach SIGSTOP before SIGTERM is sent, and I also think the 2 signals one after the other will interfere with each other.