aboutsummaryrefslogtreecommitdiffstats
path: root/preload-index.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-11-03 09:48:45 +0100
committerJunio C Hamano <gitster@pobox.com>2018-11-05 13:42:11 +0900
commite8d405662fa2e89b850ec79573953e17fea83ed1 (patch)
treef2d4316bace601796624d3ce595a079ddff3ce86 /preload-index.c
parentfd6263fb733e50cfbcf857136388bf47d9c5151f (diff)
downloadgit-e8d405662fa2e89b850ec79573953e17fea83ed1.tar.gz
preload-index.c: remove #ifdef NO_PTHREADS
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 'preload-index.c')
-rw-r--r--preload-index.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/preload-index.c b/preload-index.c
index 9e7152ab14..0e24886aca 100644
--- a/preload-index.c
+++ b/preload-index.c
@@ -7,17 +7,7 @@
#include "fsmonitor.h"
#include "config.h"
#include "progress.h"
-
-#ifdef NO_PTHREADS
-static void preload_index(struct index_state *index,
- const struct pathspec *pathspec,
- unsigned int refresh_flags)
-{
- ; /* nothing */
-}
-#else
-
-#include <pthread.h>
+#include "thread-utils.h"
/*
* Mostly randomly chosen maximum thread counts: we
@@ -108,7 +98,7 @@ static void preload_index(struct index_state *index,
struct thread_data data[MAX_PARALLEL];
struct progress_data pd;
- if (!core_preload_index)
+ if (!HAVE_THREADS || !core_preload_index)
return;
threads = index->cache_nr / THREAD_COST;
@@ -151,7 +141,6 @@ static void preload_index(struct index_state *index,
trace_performance_leave("preload index");
}
-#endif
int read_index_preload(struct index_state *index,
const struct pathspec *pathspec,