]> git.ipfire.org Git - thirdparty/git.git/commit - run-command.h
send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 3 Nov 2018 08:48:39 +0000 (09:48 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Nov 2018 04:42:11 +0000 (13:42 +0900)
commitc0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab
treee4ca6706ab8cd78073a11287d8d9e9b3e260aa91
parent10bc232d0f93957c42b2167f00fc3437b30b08b3
send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c

On systems that do not support multithread, start_async() is
implemented with fork(). This implementation details unfortunately
leak out at least in send-pack.c [1].

To keep the code base clean of NO_PTHREADS, move the this #ifdef back
to run-command.c. The new wrapper function async_with_fork() at least
helps suggest that this special "close()" is related to async in fork
mode.

[1] 09c9957cf7 (send-pack: avoid deadlock when pack-object dies early
    - 2011-04-25)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c
run-command.h
send-pack.c