Thread (2 messages) flat view 2 messages, 1 author, 2016-06-15
DORMANTno replies

[PATCH 2/2] Remove spurious 'no threads support' warnings

From: Etienne Buira <hidden>
Date: 2016-06-15 23:02:41
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help