diff --git a/lib/plist.c b/lib/plist.c index aa230897..19c2e0c2 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -104,7 +104,7 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp, unsigned int arraycount, slicecount; int rv = 0, error = 0, i, maxthreads; unsigned int reserved; - pthread_mutex_t reserved_lock; + pthread_mutex_t reserved_lock = PTHREAD_MUTEX_INITIALIZER; assert(fn != NULL); @@ -119,9 +119,6 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp, if (maxthreads <= 1 || arraycount <= 1) /* use single threaded routine */ return xbps_array_foreach_cb(xhp, array, dict, fn, arg); - if (pthread_mutex_init(&reserved_lock, PTHREAD_PROCESS_PRIVATE) != 0) - return 0; - thd = calloc(maxthreads, sizeof(*thd)); assert(thd);