xbps_array_foreach_cb_multi: improve previous.

Do not wait for the other threads to finish, just exit early.
This commit is contained in:
Juan RP 2019-12-27 15:19:22 +01:00
parent 08a1c61a4d
commit a3a1c372cb
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -152,7 +152,7 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp,
if ((rv = pthread_create(&thd[i].thread, NULL, array_foreach_thread, &thd[i])) != 0) {
error = rv;
break;
goto out;
}
}
@ -160,6 +160,7 @@ xbps_array_foreach_cb_multi(struct xbps_handle *xhp,
for (int i = 0; i < maxthreads; i++)
rv = pthread_join(thd[i].thread, NULL);
out:
free(thd);
pthread_spin_destroy(&reserved_lock);