diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-10-13 12:46:14 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-13 12:53:46 -0700 |
commit | 0c45d258ec35c1ef51523dd45e4518bd8a09258c (patch) | |
tree | 94bed687c742ce2c3b95ac6f09be982ff4b7fe40 /thread-utils.h | |
parent | e0e21283b60da5d5d9d5f95f9f2a73189fa978f1 (diff) | |
download | git-0c45d258ec35c1ef51523dd45e4518bd8a09258c.tar.gz |
pack-objects: set number of threads before checking and warning
Under NO_PTHREADS build, we warn when delta_search_threads is not
set to 1, because that is the only sensible value on a single
threaded build.
However, the auto detection that kicks in when that variable is set
to 0 (e.g. there is no configuration variable or command line option,
or an explicit --threads=0 is given from the command line to override
the pack.threads configuration to force auto-detection) was not done
before the condition to issue this warning was tested.
Move the auto-detection code and place it at an appropriate spot.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'thread-utils.h')
-rw-r--r-- | thread-utils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/thread-utils.h b/thread-utils.h index 6fb98c333c..d9a769d190 100644 --- a/thread-utils.h +++ b/thread-utils.h @@ -7,5 +7,9 @@ extern int online_cpus(void); extern int init_recursive_mutex(pthread_mutex_t*); +#else + +#define online_cpus() 1 + #endif #endif /* THREAD_COMPAT_H */ |