From: Etienne Buira Date: Sat, 11 Oct 2014 14:46:27 GMT Subject: [PATCH 2/2] Remove spurious 'no threads support' warnings Message-ID: <8d057560e40fb5edaa3a32f204718c5e561a207a.1413038338.git.etienne.buira@gmail.com> In-Reply-To: Threads count being defaulted to 0 (autodetect), and --disable-pthreads build checking that thread count==1, there were spurious warnings about threads being ignored, despite not specified on command line/conf. Fixes tests 5521 and 5526 that were broken in --disable-pthreads builds because of those warnings. Signed-off-by: Etienne Buira --- builtin/pack-objects.c | 2 +- thread-utils.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index b59f5d8..7b51453 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -51,7 +51,7 @@ static int progress = 1; static int window = 10; static unsigned long pack_size_limit; static int depth = 50; -static int delta_search_threads; +static int delta_search_threads = THREAD_COMPAT_DEFAULT_THREAD_NBR; static int pack_to_stdout; static int num_preferred_base; static struct progress *progress_state; diff --git a/thread-utils.h b/thread-utils.h index 6fb98c3..4f5e802 100644 --- a/thread-utils.h +++ b/thread-utils.h @@ -7,5 +7,8 @@ extern int online_cpus(void); extern int init_recursive_mutex(pthread_mutex_t*); +#define THREAD_COMPAT_DEFAULT_THREAD_NBR 0 +#else +#define THREAD_COMPAT_DEFAULT_THREAD_NBR 1 #endif #endif /* THREAD_COMPAT_H */ -- 1.8.5.5