-               p[i].remaining = 0;
-               ret = pthread_create(&p[i].thread, NULL,
-                                    threaded_find_deltas, &p[i]);
-               if (ret)
-                       die("unable to create thread: %s", strerror(ret));
-               active_threads++;
-       }
-
-       /* Then partition the work amongst them. */
-       for (i = 0; i < delta_search_threads; i++) {
-               unsigned sub_size = list_size / (delta_search_threads - i);
-
-               pthread_mutex_lock(&data_provider);
-               target = data_requester;
-               if (!sub_size) {
-                       pthread_mutex_unlock(&data_ready);
-                       pthread_join(target->thread, NULL);
-                       active_threads--;
-                       continue;
-               }
+               p[i].working = 1;
+               p[i].data_ready = 0;
+               pthread_mutex_init(&p[i].mutex, NULL);
+               pthread_cond_init(&p[i].cond, NULL);