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>
This commit is contained in:
Junio C Hamano
2008-11-15 04:08:14 -08:00
parent 5413812f08
commit 46059cc632
4 changed files with 31 additions and 1 deletions

View File

@@ -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)
{