summaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-24 21:59:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-10-24 21:59:10 (GMT)
commite4da4fbe0eea55c26f042f76df58bfc529b46ae0 (patch)
tree7ead155867beb400d6bed1d89be73803305f6d31 /builtin/pack-objects.c
parentbb8caad3814b49316f842a006082e79b4e46125c (diff)
parent0f4b6db3baeff8de53769b38f439408abd5a42f7 (diff)
downloadgit-e4da4fbe0eea55c26f042f76df58bfc529b46ae0.zip
git-e4da4fbe0eea55c26f042f76df58bfc529b46ae0.tar.gz
git-e4da4fbe0eea55c26f042f76df58bfc529b46ae0.tar.bz2
Merge branch 'eb/no-pthreads'
Allow us build with NO_PTHREADS=NoThanks compilation option. * eb/no-pthreads: Handle atexit list internaly for unthreaded builds pack-objects: set number of threads before checking and warning index-pack: fix compilation with NO_PTHREADS
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index a4022a7..78c659a 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1973,8 +1973,6 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
init_threaded_search();
- if (!delta_search_threads) /* --threads=0 means autodetect */
- delta_search_threads = online_cpus();
if (delta_search_threads <= 1) {
find_deltas(list, &list_size, window, depth, processed);
cleanup_threaded_search();
@@ -2686,6 +2684,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
pack_compression_level = Z_DEFAULT_COMPRESSION;
else if (pack_compression_level < 0 || pack_compression_level > Z_BEST_COMPRESSION)
die("bad pack compression level %d", pack_compression_level);
+
+ if (!delta_search_threads) /* --threads=0 means autodetect */
+ delta_search_threads = online_cpus();
+
#ifdef NO_PTHREADS
if (delta_search_threads != 1)
warning("no threads support, ignoring --threads");