[PATCH] D138952: Support: Add polling option to sys::Wait [WIP]

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 08:57:15 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Support/Unix/Program.inc:447
+          // Child's not done yet, resume it.
+          kill(PI.Pid, SIGCONT);
+        }
----------------
aganea wrote:
> arsenm wrote:
> > aganea wrote:
> > > Out of curiosity (sorry I am not well versed into Linux APIs) -- who does stop the child process & when?
> > Above a signal handler was installed. The process receives SIGALRM after the timeout from the OS. The original path here then killed off the child; this instead sends the signal to continue
> The alarm signal/handler is received in the context of the parent process. The child process' state is unaffected by the alarm, right? I suppose the alarm has the effect to make `wait4()` return (from what I understand from the doc), but again, this doesn't affect the state of the child, does it? The child should be in a 'running' state at this point. So my question is, why do we need to send `SIGCONT` at all to the child?
I don't know what I was doing before, but I added this to fix it waiting forever. Maybe I just had another bug in an earlier revision, my tests work with this removed


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138952/new/

https://reviews.llvm.org/D138952



More information about the llvm-commits mailing list