git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Etienne Buira <etienne.buira@gmail.com>
Date
Oct 11, 2014, 14:46 UTC
Message-ID
<8d057560e40fb5edaa3a32f204718c5e561a207a.1413038338.git.etienne.buira@gmail.com>
In-Reply-To
<d2df2f619967ea7ba9625868b9c77d79a1190665.1413038338.git.etienne.buira@gmail.com>

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 <etienne.buira@gmail.com>
---
 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
Previous: Etienne BuiraNext: Junio C Hamano
Message 2 of 5 in “fix compilation with --disable-pthreads”
  1. 1/2 fix compilation with --disable-pthreadsEtienne Buira, Oct 11, 2014
  2. 2/2 Remove spurious 'no threads support' warningsEtienne Buira, Oct 11, 2014
  3. Junio C HamanoOct 13, 2014
  4. Etienne BuiraOct 14, 2014
  5. Junio C HamanoOct 13, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.