summaryrefslogtreecommitdiff
path: root/wt-status.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-01-07 11:42:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-01-08 23:06:35 (GMT)
commitafe19ff7b55129d988e421ae1e0df4ec9659787a (patch)
treeb751bccbe3d1ec95451b26a26d3a775193fc65c6 /wt-status.h
parenteac2d83247ea0a265d923518c26873bb12c33778 (diff)
downloadgit-afe19ff7b55129d988e421ae1e0df4ec9659787a.zip
git-afe19ff7b55129d988e421ae1e0df4ec9659787a.tar.gz
git-afe19ff7b55129d988e421ae1e0df4ec9659787a.tar.bz2
run-command: optionally kill children on exit
When we spawn a helper process, it should generally be done and finish_command called before we exit. However, if we exit abnormally due to an early return or a signal, the helper may continue to run in our absence. In the best case, this may simply be wasted CPU cycles or a few stray messages on a terminal. But it could also mean a process that the user thought was aborted continues to run to completion (e.g., a push's pack-objects helper will complete the push, even though you killed the push process). This patch provides infrastructure for run-command to keep track of PIDs to be killed, and clean them on signal reception or input, just as we do with tempfiles. PIDs can be added in two ways: 1. If NO_PTHREADS is defined, async helper processes are automatically marked. By definition this code must be ready to die when the parent dies, since it may be implemented as a thread of the parent process. 2. If the run-command caller specifies the "clean_on_exit" option. This is not the default, as there are cases where it is OK for the child to outlive us (e.g., when spawning a pager). PIDs are cleared from the kill-list automatically during wait_or_whine, which is called from finish_command and finish_async. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.h')
0 files changed, 0 insertions, 0 deletions