mirror of
https://github.com/boostorg/build.git
synced 2026-02-13 12:22:17 +00:00
27447ae6fa79677481c2f9483b0d683c7af2cacf
sub-processes after bjam forks a new process (for example, after g++ is forked by bjam, g++ then forks sub-processes like cc1plus). The timeout code would kill the g++ process, but might not kill the subprocesses spawned by g++. I fixed this problem by making the bjam fork'ed process (g++) a session leader by calling setsid() before calling exec. The setsid call, in essence, gives all child processes a parent process id (ppid) of the g++ process id. This guarantees that killing g++ will kill all child processes spawned by g++ as well. One last comment on the maximum process time before a process is actually killed. The worst case process elapsed time is 2x seconds if -lx is given. The reason is that a process might be one second away from being killed and, if there's no other signal activity, the select function will wait x seconds before timing out and killing any active processes. So if you say -lx and monitor a build known to have lengthy processes, you may see a process with up to 2x seconds of time before it is killed. [SVN r39467]
Description
Mirrored via gitea-mirror
Languages
C++
73.8%
Python
22.6%
C
1.6%
Batchfile
0.7%
Shell
0.6%
Other
0.6%