diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-11-03 09:48:39 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-05 05:42:11 +0100 |
commit | c0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab (patch) | |
tree | e4ca6706ab8cd78073a11287d8d9e9b3e260aa91 /run-command.h | |
parent | run-command.h: include thread-utils.h instead of pthread.h (diff) | |
download | git-c0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab.tar.xz git-c0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab.zip |
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>
Diffstat (limited to 'run-command.h')
-rw-r--r-- | run-command.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/run-command.h b/run-command.h index 9b7f38202c..68f5369fc2 100644 --- a/run-command.h +++ b/run-command.h @@ -141,6 +141,7 @@ struct async { int start_async(struct async *async); int finish_async(struct async *async); int in_async(void); +int async_with_fork(void); void check_pipe(int err); /** |