X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Fpack-objects.c;h=0e8167311884d38c48a9421bf8aede89e7f2c22d;hb=165dc789d5e201a06e0de5a984e4529ae62027fc;hp=214d7ef2b12d41e8d70539fe4a4b16fde71a780a;hpb=6c1c4423e2f83037ef762d63be6edbc1f9e6e867;p=git.git diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 214d7ef2b..0e8167311 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -1529,6 +1529,8 @@ static void try_to_free_from_threads(size_t size) read_unlock(); } +try_to_free_t old_try_to_free_routine; + /* * The main thread waits on the condition that (at least) one of the workers * has stopped working (which is indicated in the .working member of @@ -1563,12 +1565,12 @@ static void init_threaded_search(void) pthread_mutex_init(&cache_mutex, NULL); pthread_mutex_init(&progress_mutex, NULL); pthread_cond_init(&progress_cond, NULL); - set_try_to_free_routine(try_to_free_from_threads); + old_try_to_free_routine = set_try_to_free_routine(try_to_free_from_threads); } static void cleanup_threaded_search(void) { - set_try_to_free_routine(NULL); + set_try_to_free_routine(old_try_to_free_routine); pthread_cond_destroy(&progress_cond); pthread_mutex_destroy(&read_mutex); pthread_mutex_destroy(&cache_mutex);