فهرست منبع

Another patch to fix the -lx timeout code. Some actions spawn
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]

K. Noel Belcourt 18 سال پیش
والد
کامیت
9769e39b5e
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      tools/build

+ 1 - 1
tools/build

@@ -1 +1 @@
-Subproject commit 1052ed2cbc4be3106f4efc98a474ed1ea89e1723
+Subproject commit 2f5d59569dbbd2cd4d9bc7724cbfffe8e48b9b3e

粤ICP备19079148号