summaryrefslogtreecommitdiff
path: root/preload-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-15 04:08:14 -0800
committerJunio C Hamano <gitster@pobox.com>2008-12-02 15:29:12 -0800
commit46059cc63259f7a3d408fc1e52e8da9d37dc49ff (patch)
tree45e13409837fb1b683eeb6928ca73e36ee61f0fc /preload-index.c
parent5413812f0800e5530036671ee55476f2771ab828 (diff)
downloadgit-46059cc63259f7a3d408fc1e52e8da9d37dc49ff.tar.gz
Makefile: introduce NO_PTHREADS
This introduces make variable NO_PTHREADS for platforms that lack the support for pthreads library or people who do not want to use it for whatever reason. When defined, it makes the multi-threaded index preloading into a no-op, and also disables threaded delta searching by pack-objects. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Mike Ralphson <mike@abacus.co.uk> Tested-by: Johannes Sixt <j6t@kdbg.org> (AIX 4.3.x) Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'preload-index.c')
-rw-r--r--preload-index.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/preload-index.c b/preload-index.c
index a6855837a4..88edc5f8a9 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -2,6 +2,14 @@
* Copyright (C) 2008 Linus Torvalds
*/
#include "cache.h"
+
+#ifdef NO_PTHREADS
+static void preload_index(struct index_state *index, const char **pathspec)
+{
+ ; /* nothing */
+}
+#else
+
#include <pthread.h>
/*
@@ -81,6 +89,7 @@ static void preload_index(struct index_state *index, const char **pathspec)
die("unable to join threaded lstat");
}
}
+#endif
int read_index_preload(struct index_state *index, const char **pathspec)
{