Browse Source

Take into account total_queued as well when deciding whether to queue a fresh request or not.

Con Kolivas 13 years ago
parent
commit
b20089fdb7
1 changed files with 4 additions and 3 deletions
  1. 4 3
      cgminer.c

+ 4 - 3
cgminer.c

@@ -3501,8 +3501,9 @@ static bool queue_request(struct thr_info *thr, bool needed)
 	int rs = requests_staged(), rq = requests_queued();
 	int rs = requests_staged(), rq = requests_queued();
 	struct workio_cmd *wc;
 	struct workio_cmd *wc;
 
 
-	if (rq >= mining_threads || (rq >= opt_queue && rs >= mining_threads))
-		return true;
+	if ((rq >= mining_threads || (rq >= opt_queue && rs >= mining_threads)) &&
+		total_queued >= opt_queue)
+			return true;
 
 
 	/* fill out work request message */
 	/* fill out work request message */
 	wc = calloc(1, sizeof(*wc));
 	wc = calloc(1, sizeof(*wc));
@@ -4335,7 +4336,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
 		struct timeval now;
 		struct timeval now;
 
 
 		sleep(interval);
 		sleep(interval);
-		if (requests_queued() < opt_queue)
+		if (requests_queued() < opt_queue || total_queued < opt_queue)
 			queue_request(NULL, false);
 			queue_request(NULL, false);
 
 
 		age_work();
 		age_work();