diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index d1144a8f7ef79f7efa5bf64141a9133cfeee66d1..29d48f38671116594494ca8904193936ed7ea77b 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2299,7 +2299,6 @@ static void init_threaded_search(void) pthread_mutex_init(&cache_mutex, NULL); pthread_mutex_init(&progress_mutex, NULL); pthread_cond_init(&progress_cond, NULL); - pthread_mutex_init(&to_pack.lock, NULL); old_try_to_free_routine = set_try_to_free_routine(try_to_free_from_threads); } diff --git a/pack-objects.c b/pack-objects.c index 6ef87e5683aacdf738c86679712078988c0899fd..f73f609884ca0d9fdf3d4109b245981c4c073fcb 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -148,6 +148,9 @@ void prepare_packing_data(struct packing_data *pdata) 1U << OE_SIZE_BITS); pdata->oe_delta_size_limit = git_env_ulong("GIT_TEST_OE_DELTA_SIZE", 1UL << OE_DELTA_SIZE_BITS); +#ifndef NO_PTHREADS + pthread_mutex_init(&pdata->lock, NULL); +#endif } struct object_entry *packlist_alloc(struct packing_data *pdata, diff --git a/t/t5321-pack-large-objects.sh b/t/t5321-pack-large-objects.sh index c36c66fbb43a739e045f6b2cd1c1dd0759a0fe01..a75eab87d36136de6484a988b712bfac03dd181d 100755 --- a/t/t5321-pack-large-objects.sh +++ b/t/t5321-pack-large-objects.sh @@ -24,7 +24,7 @@ test_expect_success 'setup' ' git index-pack --stdin