Skip to content

Commit ca9d60f

Browse files
peffgitster
authored andcommitted
Revert "index-pack: spawn threads atomically"
This reverts commit 993d38a. That commit was trying to solve a race between LSan setting up the threads stack and another thread calling exit(), by making sure that all pthread_create() calls have finished before doing any work that might trigger the exit(). But that isn't sufficient. The setup code actually runs in the individual threads themselves, not in the spawning thread's call to pthread_create(). So while it may have improved the race a bit, you can still trigger it pretty quickly with: make SANITIZE=leak cd t ./t5309-pack-delta-cycles.sh --stress Let's back out that failed attempt so we can try again. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d601aee commit ca9d60f

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

builtin/index-pack.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,15 +1336,13 @@ static void resolve_deltas(struct pack_idx_option *opts)
13361336
base_cache_limit = opts->delta_base_cache_limit * nr_threads;
13371337
if (nr_threads > 1 || getenv("GIT_FORCE_THREADS")) {
13381338
init_thread();
1339-
work_lock();
13401339
for (i = 0; i < nr_threads; i++) {
13411340
int ret = pthread_create(&thread_data[i].thread, NULL,
13421341
threaded_second_pass, thread_data + i);
13431342
if (ret)
13441343
die(_("unable to create thread: %s"),
13451344
strerror(ret));
13461345
}
1347-
work_unlock();
13481346
for (i = 0; i < nr_threads; i++)
13491347
pthread_join(thread_data[i].thread, NULL);
13501348
cleanup_thread();

0 commit comments

Comments
 (0)