Re: [PATCH 09/10] read-cache.c: remove #ifdef NO_PTHREADS
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 29, 2018, 17:21 UTC
- Message-ID
- <CACsJy8BD8nUfJoNjWCnaYgUn5+LaunOx74AgwPf5okG0OhwEXw@mail.gmail.com>
- In-Reply-To
- <9e489011-36b9-a8b3-838d-de1a097f4854@gmail.com>
On Mon, Oct 29, 2018 at 6:05 PM Ben Peart <peartben@gmail.com> wrote:
Show 12 quoted lines
> > @@ -2756,8 +2745,11 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile, > > if (ce_write(&c, newfd, &hdr, sizeof(hdr)) < 0) > > return -1; > > > > -#ifndef NO_PTHREADS > > - nr_threads = git_config_get_index_threads(); > > + if (HAVE_THREADS) > > This shouldn't be needed either. My assumption was that if someone > explicitly asked for multiple threads we're better off failing than > silently ignoring their request. The default/automatic setting will > detect the number of cpus and behave correctly.
No. I can have ~/.gitconfig shared between different machines. One with multithread support and one without. I should not have to fall back to conditional includes in order to use the same config file on the machine without multithread.
-- Duy