Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Do not stop threads if they are not started yet.
Julien Laffaye committed 13 years ago
commit 9c96db7f4e68bc410c88908c5acfd1847fad6d95
parent 8617c25
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);
		}