Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-11-03 11:48:39 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-05 07:42:11 +0300
commitc0e40a2d66e3b95d13bbc2e6e58d7b5c029d94ab (patch)
treee4ca6706ab8cd78073a11287d8d9e9b3e260aa91 /run-command.c
parent10bc232d0f93957c42b2167f00fc3437b30b08b3 (diff)
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.c')
-rw-r--r--run-command.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 84b883c213..3c3b8814df 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1246,6 +1246,15 @@ int finish_async(struct async *async)
#endif
}
+int async_with_fork(void)
+{
+#ifdef NO_PTHREADS
+ return 1;
+#else
+ return 0;
+#endif
+}
+
const char *find_hook(const char *name)
{
static struct strbuf path = STRBUF_INIT;