Merge branch 'ma/ts-cleanups' into maint
[gitweb.git] / builtin / pack-objects.c
index c753e9237a8d5981a17e872db33d5326bd8d7eab..bd391e97a4b9513bd44e327a38c2712daeeef401 100644 (file)
@@ -2170,7 +2170,10 @@ static void *threaded_find_deltas(void *arg)
 {
        struct thread_params *me = arg;
 
+       progress_lock();
        while (me->remaining) {
+               progress_unlock();
+
                find_deltas(me->list, &me->remaining,
                            me->window, me->depth, me->processed);
 
@@ -2192,7 +2195,10 @@ static void *threaded_find_deltas(void *arg)
                        pthread_cond_wait(&me->cond, &me->mutex);
                me->data_ready = 0;
                pthread_mutex_unlock(&me->mutex);
+
+               progress_lock();
        }
+       progress_unlock();
        /* leave ->working 1 so that this doesn't get more work assigned */
        return NULL;
 }