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>
This commit is contained in:
parent
2094c5e582
commit
07642942aa
22
name-hash.c
22
name-hash.c
@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
#define NO_THE_INDEX_COMPATIBILITY_MACROS
|
#define NO_THE_INDEX_COMPATIBILITY_MACROS
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
#include "thread-utils.h"
|
||||||
|
|
||||||
struct dir_entry {
|
struct dir_entry {
|
||||||
struct hashmap_entry ent;
|
struct hashmap_entry ent;
|
||||||
@ -131,22 +132,6 @@ static int cache_entry_cmp(const void *unused_cmp_data,
|
|||||||
static int lazy_try_threaded = 1;
|
static int lazy_try_threaded = 1;
|
||||||
static int lazy_nr_dir_threads;
|
static int lazy_nr_dir_threads;
|
||||||
|
|
||||||
#ifdef NO_PTHREADS
|
|
||||||
|
|
||||||
static inline int lookup_lazy_params(struct index_state *istate)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void threaded_lazy_init_name_hash(
|
|
||||||
struct index_state *istate)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include "thread-utils.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set a minimum number of cache_entries that we will handle per
|
* Set a minimum number of cache_entries that we will handle per
|
||||||
* thread and use that to decide how many threads to run (upto
|
* thread and use that to decide how many threads to run (upto
|
||||||
@ -516,6 +501,9 @@ static void threaded_lazy_init_name_hash(
|
|||||||
struct lazy_dir_thread_data *td_dir;
|
struct lazy_dir_thread_data *td_dir;
|
||||||
struct lazy_name_thread_data *td_name;
|
struct lazy_name_thread_data *td_name;
|
||||||
|
|
||||||
|
if (!HAVE_THREADS)
|
||||||
|
return;
|
||||||
|
|
||||||
k_start = 0;
|
k_start = 0;
|
||||||
nr_each = DIV_ROUND_UP(istate->cache_nr, lazy_nr_dir_threads);
|
nr_each = DIV_ROUND_UP(istate->cache_nr, lazy_nr_dir_threads);
|
||||||
|
|
||||||
@ -574,8 +562,6 @@ static void threaded_lazy_init_name_hash(
|
|||||||
free(lazy_entries);
|
free(lazy_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void lazy_init_name_hash(struct index_state *istate)
|
static void lazy_init_name_hash(struct index_state *istate)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user