name-hash.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>
Nguyễn Thái Ngọc Duy committed
Nov 3, 2018 at 09:48 UTC
07642942aa02f20623191207dd0a2730752c9533
1 file changed
+4
-18
name-hash.c
+4
-18
@@ -7,6 +7,7 @@
7
*/
8
#define NO_THE_INDEX_COMPATIBILITY_MACROS
9
#include "cache.h"
10
+#include "thread-utils.h"
11
12
struct dir_entry {
13
struct hashmap_entry ent;
@@ -131,22 +132,6 @@ static int cache_entry_cmp(const void *unused_cmp_data,
132
static int lazy_try_threaded = 1;
133
static int lazy_nr_dir_threads;
134
134
-#ifdef NO_PTHREADS
135
-
136
-static inline int lookup_lazy_params(struct index_state *istate)
137
-{
138
- return 0;
139
-}
140
-
141
-static inline void threaded_lazy_init_name_hash(
142
- struct index_state *istate)
143
-{
144
-}
145
-
146
-#else
147
-
148
-#include "thread-utils.h"
149
-
135
/*
136
* Set a minimum number of cache_entries that we will handle per
137
* thread and use that to decide how many threads to run (upto
@@ -516,6 +501,9 @@ static void threaded_lazy_init_name_hash(
501
struct lazy_dir_thread_data *td_dir;
502
struct lazy_name_thread_data *td_name;
503
504
+ if (!HAVE_THREADS)
505
+ return;
506
+
507
k_start = 0;
508
nr_each = DIV_ROUND_UP(istate->cache_nr, lazy_nr_dir_threads);
509
@@ -574,8 +562,6 @@ static void threaded_lazy_init_name_hash(
562
free(lazy_entries);
563
}
564
577
-#endif
578
-
565
static void lazy_init_name_hash(struct index_state *istate)
566
{
567