Browse Source

Check for work restart after the hashmeter is invoked for we lose the hashes otherwise contributed in the count.

ckolivas 13 years ago
parent
commit
f9d0324d2a
1 changed files with 15 additions and 16 deletions
  1. 15 16
      cgminer.c

+ 15 - 16
cgminer.c

@@ -4101,22 +4101,6 @@ void *miner_thread(void *userdata)
 
 
 			gettimeofday(&getwork_start, NULL);
 			gettimeofday(&getwork_start, NULL);
 
 
-			if (unlikely(mythr->work_restart)) {
-
-				/* Apart from device_thread 0, we stagger the
-				 * starting of every next thread to try and get
-				 * all devices busy before worrying about
-				 * getting work for their extra threads */
-				if (!primary) {
-					struct timespec rgtp;
-
-					rgtp.tv_sec = 0;
-					rgtp.tv_nsec = 250 * mythr->device_thread * 1000000;
-					nanosleep(&rgtp, NULL);
-				}
-				break;
-			}
-
 			if (unlikely(!hashes)) {
 			if (unlikely(!hashes)) {
 				applog(LOG_ERR, "%s %d failure, disabling!", api->name, cgpu->device_id);
 				applog(LOG_ERR, "%s %d failure, disabling!", api->name, cgpu->device_id);
 				cgpu->deven = DEV_DISABLED;
 				cgpu->deven = DEV_DISABLED;
@@ -4183,6 +4167,21 @@ void *miner_thread(void *userdata)
 				tv_lastupdate = tv_end;
 				tv_lastupdate = tv_end;
 			}
 			}
 
 
+			if (unlikely(mythr->work_restart)) {
+				/* Apart from device_thread 0, we stagger the
+				 * starting of every next thread to try and get
+				 * all devices busy before worrying about
+				 * getting work for their extra threads */
+				if (!primary) {
+					struct timespec rgtp;
+
+					rgtp.tv_sec = 0;
+					rgtp.tv_nsec = 250 * mythr->device_thread * 1000000;
+					nanosleep(&rgtp, NULL);
+				}
+				break;
+			}
+
 			if (unlikely(mythr->pause || cgpu->deven != DEV_ENABLED))
 			if (unlikely(mythr->pause || cgpu->deven != DEV_ENABLED))
 				mt_disable(mythr, thr_id, api);
 				mt_disable(mythr, thr_id, api);