diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-01-16 21:11:58 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-01-16 21:11:58 +0300 |
commit | b27f67aa932e61906ad92bd09d3051d9c54eb148 (patch) | |
tree | ee19f93e1c82e155fecf0520e288518d0d68258d | |
parent | 6484eb9a97fe3cd81a2d5711183b93494e6ddefa (diff) | |
parent | 993d38a0669a8056d496797516e743e26b6b8b54 (diff) |
Merge branch 'jk/index-pack-lsan-false-positive-fix'
Fix false positive reported by leak sanitizer.
* jk/index-pack-lsan-false-positive-fix:
index-pack: spawn threads atomically
-rw-r--r-- | builtin/index-pack.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 0841b6940a..1ea87e01f2 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1255,6 +1255,7 @@ static void resolve_deltas(void) base_cache_limit = delta_base_cache_limit * nr_threads; if (nr_threads > 1 || getenv("GIT_FORCE_THREADS")) { init_thread(); + work_lock(); for (i = 0; i < nr_threads; i++) { int ret = pthread_create(&thread_data[i].thread, NULL, threaded_second_pass, thread_data + i); @@ -1262,6 +1263,7 @@ static void resolve_deltas(void) die(_("unable to create thread: %s"), strerror(ret)); } + work_unlock(); for (i = 0; i < nr_threads; i++) pthread_join(thread_data[i].thread, NULL); cleanup_thread(); |