Browse Source

Merge commit '2480cf2' into bfgminer-2.6.x

Conflicts:
	driver-bitforce.c
Luke Dashjr 13 years ago
parent
commit
1cf76106bc
2 changed files with 11 additions and 1 deletions
  1. 10 1
      driver-bitforce.c
  2. 1 0
      miner.h

+ 10 - 1
driver-bitforce.c

@@ -346,6 +346,11 @@ static bool bitforce_get_temp(struct cgpu_info *bitforce)
 	if (!fdDev)
 		return false;
 
+	/* Do not try to get the temperature if we're polling for a result to
+	 * minimise the change of interleaved results */
+	if (bitforce->polling)
+		return true;
+
 	/* It is not critical getting temperature so don't get stuck if  we
 	 * can't grab the mutex here */
 	if (mutex_trylock(&bitforce->device_mutex))
@@ -641,7 +646,11 @@ static int64_t bitforce_scanhash(struct thr_info *thr, struct work *work, int64_
 		bitforce->wait_ms = sleep_time;
 	}
 
-	ret = bitforce_get_result(thr, work);
+	{
+		bitforce->polling = true;
+		ret = bitforce_get_result(thr, work);
+		bitforce->polling = false;
+	}
 
 	if (ret == -1) {
 commerr:

+ 1 - 0
miner.h

@@ -365,6 +365,7 @@ struct cgpu_info {
 	unsigned int avg_wait_d;
 	uint32_t nonces;
 	bool nonce_range;
+	bool polling;
 #endif
 	pthread_mutex_t		device_mutex;