]> rtime.felk.cvut.cz Git - git.git/commitdiff
Merge branch 'jk/index-pack-threading-races'
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2014 18:38:33 +0000 (11:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2014 18:38:34 +0000 (11:38 -0700)
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

1  2 
builtin/index-pack.c

index 5568a5bc3b69be79f0d5fa09c694fd976c8319cc,885fa93fd3038ad67ea1d74ea7562843efe3ec2a..eebf1a8fc21fd551f3917ad23ab5a45dff302f23
@@@ -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);
  }