1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-03 15:46:17 +02:00

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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2018-11-03 09:48:45 +01:00 committed by Junio C Hamano
parent fd6263fb73
commit e8d405662f

View File

@ -7,17 +7,7 @@
#include "fsmonitor.h" #include "fsmonitor.h"
#include "config.h" #include "config.h"
#include "progress.h" #include "progress.h"
#include "thread-utils.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>
/* /*
* Mostly randomly chosen maximum thread counts: we * 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 thread_data data[MAX_PARALLEL];
struct progress_data pd; struct progress_data pd;
if (!core_preload_index) if (!HAVE_THREADS || !core_preload_index)
return; return;
threads = index->cache_nr / THREAD_COST; threads = index->cache_nr / THREAD_COST;
@ -151,7 +141,6 @@ static void preload_index(struct index_state *index,
trace_performance_leave("preload index"); trace_performance_leave("preload index");
} }
#endif
int read_index_preload(struct index_state *index, int read_index_preload(struct index_state *index,
const struct pathspec *pathspec, const struct pathspec *pathspec,