diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-02-08 16:22:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-08 16:22:12 -0800 |
commit | a064af6ef4b3666e204176a7f92525593435e9c5 (patch) | |
tree | 9d19a414ab8941e798f102251f3a324954266e65 /builtin | |
parent | 16a830f6c2bed647a31814b3ac4e5a876e897ff1 (diff) | |
parent | 993d38a0669a8056d496797516e743e26b6b8b54 (diff) | |
download | git-a064af6ef4b3666e204176a7f92525593435e9c5.tar.gz |
Merge branch 'jk/index-pack-lsan-false-positive-fix' into maint-2.43
Fix false positive reported by leak sanitizer.
* jk/index-pack-lsan-false-positive-fix:
index-pack: spawn threads atomically
Diffstat (limited to 'builtin')
-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(); |