Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Do not stop threads if they are not started yet.
Julien Laffaye committed 13 years ago
commit 9c96db7f4e68bc410c88908c5acfd1847fad6d95
parent 8617c254cba00b64c71a3b78c0457ecaec16dfe2
1 file changed +7 -7
modified libpkg/pkg_repo.c
@@ -799,15 +799,15 @@ pkg_create_repo(char *path, bool force,
	}

	cleanup:
-
	// Cancel running threads
-
	if (retcode != EPKG_OK) {
-
		pthread_mutex_lock(&thd_data.fts_m);
-
		thd_data.stop = true;
-
		pthread_mutex_unlock(&thd_data.fts_m);
-
	}

-
	// Join on threads to release thread IDs
	if (tids != NULL) {
+
		// Cancel running threads
+
		if (retcode != EPKG_OK) {
+
			pthread_mutex_lock(&thd_data.fts_m);
+
			thd_data.stop = true;
+
			pthread_mutex_unlock(&thd_data.fts_m);
+
		}
+
		// Join on threads to release thread IDs
		for (int i = 0; i < num_workers; i++) {
			pthread_join(tids[i], NULL);
		}