Browse Source

Stop the mining threads before trying to kill them.

Con Kolivas 14 years ago
parent
commit
61328a4292
1 changed files with 10 additions and 1 deletions
  1. 10 1
      cgminer.c

+ 10 - 1
cgminer.c

@@ -1702,8 +1702,17 @@ void kill_work(void)
 	thr = &thr_info[watchdog_thr_id];
 	thr = &thr_info[watchdog_thr_id];
 	thr_info_cancel(thr);
 	thr_info_cancel(thr);
 
 
-	applog(LOG_DEBUG, "Killing off mining threads");
+	applog(LOG_DEBUG, "Stopping mining threads");
 	/* Stop the mining threads*/
 	/* Stop the mining threads*/
+	for (i = 0; i < mining_threads; i++) {
+		thr = &thr_info[i];
+		thr->pause = true;
+	}
+
+	sleep(1);
+
+	applog(LOG_DEBUG, "Killing off mining threads");
+	/* Kill the mining threads*/
 	for (i = 0; i < mining_threads; i++) {
 	for (i = 0; i < mining_threads; i++) {
 		thr = &thr_info[i];
 		thr = &thr_info[i];
 		thr_info_cancel(thr);
 		thr_info_cancel(thr);