From: Junio C Hamano Date: Tue, 30 Sep 2014 05:09:24 +0000 (-0700) Subject: Merge branch 'jk/index-pack-threading-races' into maint X-Git-Tag: v2.1.2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46092ebf224d45464ef5663544b19b38b95a51c9;p=git Merge branch 'jk/index-pack-threading-races' into maint When receiving an invalid pack stream that records the same object twice, multiple threads got confused due to a race. * jk/index-pack-threading-races: index-pack: fix race condition with duplicate bases --- 46092ebf224d45464ef5663544b19b38b95a51c9 diff --cc builtin/index-pack.c index 5568a5bc3b,885fa93fd3..eebf1a8fc2 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@@ -157,10 -157,9 +162,11 @@@ static void cleanup_thread(void pthread_mutex_destroy(&read_mutex); pthread_mutex_destroy(&counter_mutex); pthread_mutex_destroy(&work_mutex); + pthread_mutex_destroy(&type_cas_mutex); if (show_stat) pthread_mutex_destroy(&deepest_delta_mutex); + for (i = 0; i < nr_threads; i++) + close(thread_data[i].pack_fd); pthread_key_delete(key); free(thread_data); }