зеркало из https://github.com/microsoft/git.git
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
This commit is contained in:
Коммит
a064af6ef4
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче