Browse Source

Merge commit 'b1cdacd' into bfgminer

Conflicts:
	driver-bitforce.c
Luke Dashjr 13 years ago
parent
commit
2609e1724e
1 changed files with 7 additions and 5 deletions
  1. 7 5
      driver-bitforce.c

+ 7 - 5
driver-bitforce.c

@@ -137,10 +137,10 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
 	struct cgpu_info *bitforce = thr->cgpu;
 	int fdDev = bitforce->device_fd;
 
+	int i;
 	char pdevbuf[0x100];
 	unsigned char ob[61] = ">>>>>>>>12345678901234567890123456789012123456789012>>>>>>>>";
 	struct timeval tdiff;
-	int i;
 	char *pnoncebuf;
 	char *s;
 	uint32_t nonce;
@@ -200,8 +200,13 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
 	/* Start looking for results. Stupid polling every 10ms... */
 	tdiff.tv_sec = 0;
 	tdiff.tv_usec = 10000;
+
+	thr->work_restart = 0;
 	while (42) {
-		int rc = restart_wait(&tdiff);
+		if (unlikely(thr->work_restart))
+			return 0;
+		usleep(10000);
+		i += 10;
 
 		BFwrite(fdDev, "ZFX", 3);
 		BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
@@ -211,9 +216,6 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
 		}
 		if (pdevbuf[0] != 'B')
 		    break;
-		if (!rc)
-			return 0;
-		i += 10;
 
 		/* After 2/3 of the average cycle time (~3.4s), request more work */
 		if (i == 3400)