Commit f4f018b4984a87712300c84e3db71a62551a792b

Con Kolivas 2011-07-21T10:15:17

Don't try to stop/cancel threads that don't exist.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/main.c b/main.c
index d5ec941..240c96b 100644
--- a/main.c
+++ b/main.c
@@ -981,6 +981,8 @@ void kill_work(void)
 	/* Stop the mining threads*/
 	for (i = 0; i < mining_threads; i++) {
 		thr = &thr_info[i];
+		if (!thr->pth)
+			continue;
 		tq_freeze(thr->q);
 		/* No need to check if this succeeds or not */
 		pthread_cancel(thr->pth);