From: Junio C Hamano Date: Fri, 19 Sep 2014 18:38:33 +0000 (-0700) Subject: Merge branch 'jk/index-pack-threading-races' X-Git-Tag: v2.2.0-rc0~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd656f6e7bea734896be25d281e983ab9e1f5384;p=thirdparty%2Fgit.git Merge branch 'jk/index-pack-threading-races' When receiving an invalid pack stream that records the same object twice, multiple threads got confused due to a race. We should reject or correct such a stream upon receiving, but that will be a larger change. * jk/index-pack-threading-races: index-pack: fix race condition with duplicate bases --- bd656f6e7bea734896be25d281e983ab9e1f5384 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); }