Browse Source

Add no_work bool to set when we are in an underrun situation

Luke Dashjr 12 years ago
parent
commit
87cee13a22
1 changed files with 4 additions and 0 deletions
  1. 4 0
      miner.c

+ 4 - 0
miner.c

@@ -203,6 +203,7 @@ bool opt_api_listen;
 bool opt_api_network;
 bool opt_api_network;
 bool opt_delaynet;
 bool opt_delaynet;
 bool opt_disable_pool;
 bool opt_disable_pool;
+static bool no_work;
 char *opt_icarus_options = NULL;
 char *opt_icarus_options = NULL;
 char *opt_icarus_timing = NULL;
 char *opt_icarus_timing = NULL;
 bool opt_worktime;
 bool opt_worktime;
@@ -7622,6 +7623,7 @@ retry:
 			else
 			else
 				applog(LOG_WARNING, "Staged work underrun; not automatically increasing above %d", opt_queue);
 				applog(LOG_WARNING, "Staged work underrun; not automatically increasing above %d", opt_queue);
 			staged_full = false;  // Let it fill up before triggering an underrun again
 			staged_full = false;  // Let it fill up before triggering an underrun again
+			no_work = true;
 		}
 		}
 		ts = (struct timespec){ .tv_sec = opt_log_interval, };
 		ts = (struct timespec){ .tv_sec = opt_log_interval, };
 		if (ETIMEDOUT == pthread_cond_timedwait(&getq->cond, stgd_lock, &ts))
 		if (ETIMEDOUT == pthread_cond_timedwait(&getq->cond, stgd_lock, &ts))
@@ -7630,6 +7632,8 @@ retry:
 			pthread_cond_wait(&getq->cond, stgd_lock);
 			pthread_cond_wait(&getq->cond, stgd_lock);
 		}
 		}
 	}
 	}
+	
+	no_work = false;
 
 
 	hc = HASH_COUNT(staged_work);
 	hc = HASH_COUNT(staged_work);
 	/* Find clone work if possible, to allow masters to be reused */
 	/* Find clone work if possible, to allow masters to be reused */