Skip to content

Commit a064af6

Browse files
committed
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
2 parents 16a830f + 993d38a commit a064af6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/index-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,13 +1255,15 @@ static void resolve_deltas(void)
12551255
base_cache_limit = delta_base_cache_limit * nr_threads;
12561256
if (nr_threads > 1 || getenv("GIT_FORCE_THREADS")) {
12571257
init_thread();
1258+
work_lock();
12581259
for (i = 0; i < nr_threads; i++) {
12591260
int ret = pthread_create(&thread_data[i].thread, NULL,
12601261
threaded_second_pass, thread_data + i);
12611262
if (ret)
12621263
die(_("unable to create thread: %s"),
12631264
strerror(ret));
12641265
}
1266+
work_unlock();
12651267
for (i = 0; i < nr_threads; i++)
12661268
pthread_join(thread_data[i].thread, NULL);
12671269
cleanup_thread();

0 commit comments

Comments
 (0)